Static Analysis Problem Type Reference
A format specifier requires a pointer as the corresponding argument.
This diagnostic is emitted for the special case of %s and %n format specifiers in a printf-type call. In this case, the argument corresponding to the %s must be a pointer to a null-terminated string of characters and the argument corresponding to the %n must be a pointer to int.
|
ID |
Code Location |
Description |
|---|---|---|
|
1 |
Call site |
The actual argument that was passed |
#include <stdio.h>
int main(int argc, char **argv)
{
int n = 1;
// bad: should be printf("%d %n", *argv, argc, &n);
printf("%s %d %n", argc, argc, n);
return n;
}