https://issues.dlang.org/show_bug.cgi?id=22784

          Issue ID: 22784
           Summary: pragma(printf) applies to nested functions
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

example:

import core.stdc.stdarg; 
extern(C)
pragma(printf)
void fn(const(char)* fmt, ...)
{ 
    void inner(){}
}

output:

test.d(6): Error: function `test.fn.inner` `pragma(printf)` functions must be
`extern(C) void inner([parameters...], const(char)*, va_list)`

i'd expect the pragma to apply to the outer function only so you can have
non-printf-like helper functions inside a printf-like function

--

Reply via email to