Consider the following code sample:
#define STRING_LITERAL "%u, %u"
const char string_const[ ] = "%u, %u";
snprintf(dest_buff, sizeof(dest_buff), STRING_LITERAL, arg1, arg2, arg3);
My compiler then issues a Warning: the format string ends before this argument
Now if I change the instruction to:
snprintf(dest_buff, sizeof(dest_buff), string_const, arg1, arg2, arg3);
Then no warning is issued by the compiler.
My question is: does such a behavior comply with the C99 standard?