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.