Static Analysis Problem Type Reference
A "*" format specifier is not compatible with the type of the corresponding argument.
Within a printf-style format specifier, one can specify the field width and precision. These can either be literal numbers, as in "%.5s", or they can be specified as "*", as in "%.*s". The meaning of "*" is that width or precision value will be specified by the next corresponding argument. This error indicates that the next corresponding argument does not have the required integer type.
|
ID |
Code Location |
Description |
|---|---|---|
|
1 |
Format mismatch |
The lace where the format string was used |
#include <stdio.h>
extern double x,y,z;
int main(int argc, char **argv)
{
printf("%*.*f", x, y, z); // x and y should be integer type
}