Static Analysis Problem Type Reference

Format to argument type mismatch

A format specifier is not compatible with the type of the corresponding argument.

For example, "%s" prints a string, so the actual parameter should be a string, not an integer or floating point value.

ID

Code Location

Description

1

Format mismatch

The place where the format string was used

Example

          
#include <stdio.h>

extern int x,y;

int main(int argc, char **argv)
{
    printf("%f %s", x, y); // format specifiers expect double and string, not int
}