Argument corresponding to * for width or precision value should be type int

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

Observation

Description

1

Format mismatch

Place where the format string was used

Example

          
#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
}
        

Copyright © 2010, Intel Corporation. All rights reserved.