Home | History | Annotate | Download | only in Sema

Lines Matching full:argument

10 int printf(const char *restrict, ...); // expected-note{{passing argument to parameter here}}
18 int vsprintf(char *restrict, const char *restrict, va_list); // expected-note{{passing argument to parameter here}}
62 // warn only if the format string argument is a parameter that is not itself
87 printf("yes" ?: "no %d", 1); // expected-warning{{data argument not used by format string}}
94 printf("%n", b); // expected-warning{{format specifies type 'int *' but the argument has type 'char *'}}
100 printf("%hhn", (int*)0); // expected-warning{{format specifies type 'signed char *' but the argument has type 'int *'}}
104 printf("%hn", (int*)0); // expected-warning{{format specifies type 'short *' but the argument has type 'int *'}}
108 printf("%n", (char*)0); // expected-warning{{format specifies type 'int *' but the argument has type 'char *'}}
112 printf("%ln", (int*)0); // expected-warning{{format specifies type 'long *' but the argument has type 'int *'}}
116 printf("%lln", (int*)0); // expected-warning{{format specifies type 'long long *' but the argument has type 'int *'}}
120 printf("%qn", (int*)0); // expected-warning{{format specifies type 'long long *' but the argument has type 'int *'}}
130 sprintf(buf,"%%%%%ld%d%d", 1, 2, 3); // expected-warning{{format specifies type 'long' but the argument has type 'int'}}
131 snprintf(buf, 2, "%%%%%ld%;%d", 1, 2, 3); // expected-warning{{format specifies type 'long' but the argument has type 'int'}} expected-warning {{invalid conversion specifier ';'}}
164 printf("%*d"); // expected-warning {{'*' specified field width is missing a matching 'int' argument}}
165 printf("%.*d"); // expected-warning {{'.*' specified field precision is missing a matching 'int' argument}}
167 printf("%*d","foo",x); // expected-warning {{field width should have type 'int', but argument has type 'char *'}}
168 printf("%.*d","foo",x); // expected-warning {{field precision should have type 'int', but argument has type 'char *'}}
212 printf("%*d\n"); // expected-warning{{'*' specified field width is missing a matching 'int' argument}}
213 printf("%*.*d\n", x); // expected-warning{{'.*' specified field precision is missing a matching 'int' argument}}
214 printf("%*d\n", f, x); // expected-warning{{field width should have type 'int', but argument has type 'double'}}
215 printf("%*.*d\n", x, f, x); // expected-warning{{field precision should have type 'int', but argument has type 'double'}}
218 printf("%d\n", x, x); // expected-warning{{data argument not used by format string}}
223 printf("%f", 4); // expected-warning{{format specifies type 'double' but the argument has type 'int'}}
225 printf("%qd", x); // expected-warning{{format specifies type 'long long' but the argument has type 'int'}}
231 printf("%d", (long long) 10); // expected-warning{{format specifies type 'int' but the argument has type 'long long'}}
233 printf("%f\n", (long double) 1.0); // expected-warning{{format specifies type 'double' but the argument has type 'long double'}}
236 printf("%c\n", "x"); // expected-warning{{format specifies type 'int' but the argument has type 'char *'}}
237 printf("%c\n", 1.23); // expected-warning{{format specifies type 'int' but the argument has type 'double'}}
244 printf("%hhu", (short) 10); // expected-warning{{format specifies type 'unsigned char' but the argument has type 'short'}}
245 printf("%hu\n", (unsigned char) 1); // expected-warning{{format specifies type 'unsigned short' but the argument has type 'unsigned char'}}
246 printf("%hu\n", (uint8_t)1); // expected-warning{{format specifies type 'unsigned short' but the argument has type 'uint8_t'}}
251 printf("%p", 123); // expected-warning{{format specifies type 'void *' but the argument has type 'int'}}
265 printf ("%.4s\n", &buf); // expected-warning{{format specifies type 'char *' but the argument has type 'unsigned char (*)[4]'}}
268 asprintf(&b, "%d", "asprintf"); // expected-warning{{format specifies type 'int' but the argument has type 'char *'}}
274 printf("x: '0%hhd'\n", x); // expected-warning {{format specifies type 'char' but the argument has type 'short'}}
295 printf("%s", s); // expected-warning{{format specifies type 'char *' but the argument has type 'wchar_t *'}}
301 printf("%S", "hello"); // expected-warning{{but the argument has type 'char *'}}
311 printf("%1$d", (int) 2, 2); // expected-warning{{data argument not used by format string}}
312 printf("%1$d%1$f", (int) 2); // expected-warning{{format specifies type 'double' but the argument has type 'int'}}
315 printf("%2$*8$d", (int) 2, (int) 3); // expected-warning{{specified field width is missing a matching 'int' argument}}
320 // PR 6697 - Handle format strings where the data argument is not adjacent to the format string
324 myprintf_PR_6697("%s\n", 1, (int)0); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
328 myprintf_PR_6697("%2$s\n", 1, "foo"); // expected-warning{{data argument position '2' exceeds the number of data arguments (1)}}
329 myprintf_PR_6697("%18$s\n", 1, "foo"); // expected-warning{{data argument position '18' exceeds the number of data arguments (1)}}
330 myprintf_PR_6697("%1$s\n", 1, (int) 0); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
368 printf("%lc", 1.0); // expected-warning{{the argument has type 'double'}}
370 printf("%lc", &c); // expected-warning{{the argument has type 'wint_t *'}}
417 printf("%s", 1); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
430 printf("%s", 2); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
463 printf(kFormat2, 1, "foo"); // expected-warning{{data argument position '18' exceeds the number of data arguments (2)}}
464 printf("%18$s\n", 1, "foo"); // expected-warning{{data argument position '18' exceeds the number of data arguments (2)}}
475 printf(kFormat6, 5); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
476 printf("%s", 5); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}}
495 printf(kFormat11); // expected-warning{{'*' specified field width is missing a matching 'int' argument}}
496 printf("%*d"); // expected-warning{{'*' specified field width is missing a matching 'int' argument}}
499 printf(kFormat12, 4.4); // expected-warning{{field width should have type 'int', but argument has type 'double'}}
500 printf("%*d", 4.4); // expected-warning{{field width should have type 'int', but argument has type 'double'}}
520 // when the original string is within the argument expression.
524 printf(kFormat17, (int[]){0}); // expected-warning{{format specifies type 'unsigned short' but the argument}}
526 printf("%a", (long double)0); // expected-warning{{format specifies type 'double' but the argument has type 'long double'}}
532 // Make sure we point at the offending argument rather than the format string.
554 PRINT1("%d\n", x); // no-warning{{extra argument is system header is OK}}
581 printf("%n", cip); // expected-warning{{format specifies type 'int *' but the argument has type 'const int *'}}
582 printf("%n", cvip); // expected-warning{{format specifies type 'int *' but the argument has type 'const volatile int *'}}
592 printf("%n", (cip_t)0); // expected-warning{{format specifies type 'int *' but the argument has type 'cip_t' (aka 'const int *')}}