(0000048)
gkajmowi
02-16-05 10:07
|
This is intended behavior. The -Wformat=2 command checks to ensure that certain functions are given proper values. snprintf accepts a const char * as a parameter which acts as a formating string.
The warnings occur in [i][o]stream because the functions which write data to a stream must build the format function first. This results in two calls to snprintf. The first call builds the format string for the second. Naturally, the second call cannot use a string literal because it is using a variable. Thus the compiler informs you that
the argument isn't being checked. This is only a warning message because you have asked for all such commands to be checked, and in this case they cannot be.
Suggestions on how to re-write the code to avoid this problem are welcome. Otherwise, this is intended behavior. |