[Bug other/62002] -fcilkplus switch breaks format attribute.

vincenzo.romano at notorand dot it gcc-bugzilla@gcc.gnu.org
Wed Nov 15 08:54:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62002

Vincenzo Romano <vincenzo.romano at notorand dot it> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vincenzo.romano at notorand dot it

--- Comment #7 from Vincenzo Romano <vincenzo.romano at notorand dot it> ---
The original code snippet is wrong.

It should read

void bar(char const *, ...) __attribute__((__format__(__printf__, 1, 2)));

instead of

void bar(char const *, ...) __attribute__((__format__(__printf__, 2, 3)));

Accordingly to the documentation at

https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes

The second __format__() argument is the 1-based position of the formatting
string, while the third one is the 1-based position of the first argument to be
checked.


More information about the Gcc-bugs mailing list