__attribute__ format doesn't work

Michael Vanier mvanier@cs.caltech.edu
Fri Mar 28 15:24:00 GMT 2003


I believe I have found a bug in the attribute system of gcc.

I declared a function as follows:

extern Result ExecuteCommandStringFormatted(const char *cmd, ...)
    __attribute__ ((format (printf, 1, 2)));

and then used it with a known bogus invocation in order to see if warnings
were generated:

ExecuteCommandStringFormatted("%g %g %g");

and compiled.  No warnings were generated, even though warnings were
generated if I used (say) printf instead.  My compiler options were -Wall
-Wstrict-prototypes.  I am running gcc-3.2 on a Debian Linux system.

Is this a real bug, or am I doing something wrong?

Thanks,

Mike



More information about the Gcc-bugs mailing list