[ACCEPTED]-How to use the GCC attribute 'format'?-printf

Accepted answer
Score: 11

The documentation has the answer you need. Particularly:

  1. Yes
  2. The one you have posted is correct (format(printf, 1, 0)). 1 because the format string is parameter 1, 0 because there are no variadic arguments to be checked.


Score: 4

Take a look at the GCC docs on gnu.org. As for the last question, my 4 guess is that MyPrintf is not a template function 3 and the only definition available takes 2 char const* as the first argument so it feels safe 1 making the suggestion.

More Related questions