• Home
  • Raw
  • Download

Lines Matching full:warning

31   printf(s); // expected-warning {{format string is not a string literal}}  in check_string_literal()
33 vprintf(s,ap); // expected-warning {{format string is not a string literal}} in check_string_literal()
34 fprintf(fp,s); // expected-warning {{format string is not a string literal}} in check_string_literal()
36 vfprintf(fp,s,ap); // expected-warning {{format string is not a string literal}} in check_string_literal()
37 asprintf(&b,s); // expected-warning {{format string is not a string lit}} in check_string_literal()
39 vasprintf(&b,s,ap); // expected-warning {{format string is not a string literal}} in check_string_literal()
40 sprintf(buf,s); // expected-warning {{format string is not a string literal}} in check_string_literal()
42 snprintf(buf,2,s); // expected-warning {{format string is not a string lit}} in check_string_literal()
44 __builtin___sprintf_chk(buf,0,-1,s); // expected-warning {{format string is not a string literal}} in check_string_literal()
46 __builtin___snprintf_chk(buf,2,0,-1,s); // expected-warning {{format string is not a string lit}} in check_string_literal()
48 vsprintf(buf,s,ap); // expected-warning {{format string is not a string lit}} in check_string_literal()
49 vsnprintf(buf,2,s,ap); // expected-warning {{format string is not a string lit}} in check_string_literal()
50 vsnprintf(buf,2,global_fmt,ap); // expected-warning {{format string is not a string literal}} in check_string_literal()
51 …__builtin___vsnprintf_chk(buf,2,0,-1,s,ap); // expected-warning {{format string is not a string li… in check_string_literal()
52 …__builtin___vsnprintf_chk(buf,2,0,-1,global_fmt,ap); // expected-warning {{format string is not a … in check_string_literal()
54 vscanf(s, ap); // expected-warning {{format string is not a string literal}} in check_string_literal()
57 printf(fmt, 1, 2); // expected-warning{{data argument not used}} in check_string_literal()
61 "%*d", 1, 1); // no-warning in check_string_literal()
64 "%*d", 1, 1); // no-warning in check_string_literal()
69 printf("%*d", (unsigned) 1, 1); // no-warning in check_string_literal()
81 printf(s); // expected-warning {{format string is not a string literal}} in check_string_literal2()
83 vprintf(s,ap); // no-warning in check_string_literal2()
84 fprintf(fp,s); // expected-warning {{format string is not a string literal}} in check_string_literal2()
86 vfprintf(fp,s,ap); // no-warning in check_string_literal2()
87 asprintf(&b,s); // expected-warning {{format string is not a string lit}} in check_string_literal2()
89 vasprintf(&b,s,ap); // no-warning in check_string_literal2()
90 sprintf(buf,s); // expected-warning {{format string is not a string literal}} in check_string_literal2()
92 snprintf(buf,2,s); // expected-warning {{format string is not a string lit}} in check_string_literal2()
94 __builtin___vsnprintf_chk(buf,2,0,-1,s,ap); // no-warning in check_string_literal2()
96 vscanf(s, ap); // expected-warning {{format string is not a string literal}} in check_string_literal2()
100 printf(i == 1 ? "yes" : "no"); // no-warning in check_conditional_literal()
101 printf(i == 0 ? (i == 1 ? "yes" : "no") : "dont know"); // no-warning in check_conditional_literal()
102 …printf(i == 0 ? (i == 1 ? s : "no") : "dont know"); // expected-warning{{format string is not a st… in check_conditional_literal()
104 printf("yes" ?: "no %d", 1); // expected-warning{{data argument not used by format string}} in check_conditional_literal()
105 printf(0 ? "yes %s" : "no %d", 1); // no-warning in check_conditional_literal()
106 printf(0 ? "yes %d" : "no %s", 1); // expected-warning{{format specifies type 'char *'}} in check_conditional_literal()
108 printf(0 ? "yes" : "no %d", 1); // no-warning in check_conditional_literal()
109 printf(0 ? "yes %d" : "no", 1); // expected-warning{{data argument not used by format string}} in check_conditional_literal()
110 printf(1 ? "yes" : "no %d", 1); // expected-warning{{data argument not used by format string}} in check_conditional_literal()
111 printf(1 ? "yes %d" : "no", 1); // no-warning in check_conditional_literal()
112 printf(i ? "yes" : "no %d", 1); // no-warning in check_conditional_literal()
113 printf(i ? "yes %s" : "no %d", 1); // expected-warning{{format specifies type 'char *'}} in check_conditional_literal()
114 printf(i ? "yes" : "no %d", 1, 2); // expected-warning{{data argument not used by format string}} in check_conditional_literal()
116 printf(i ? "%*s" : "-", i, s); // no-warning in check_conditional_literal()
117 …printf(i ? "yes" : 0 ? "no %*d" : "dont know %d", 1, 2); // expected-warning{{data argument not us… in check_conditional_literal()
118 …printf(i ? "%i\n" : "%i %s %s\n", i, s); // expected-warning{{more '%' conversions than data argum… in check_conditional_literal()
125 …printf("%n", b); // expected-warning{{format specifies type 'int *' but the argument has type 'cha… in check_writeback_specifier()
126 printf("%n", &x); // no-warning in check_writeback_specifier()
128 printf("%hhn", (signed char*)0); // no-warning in check_writeback_specifier()
129 printf("%hhn", (char*)0); // no-warning in check_writeback_specifier()
130 printf("%hhn", (unsigned char*)0); // no-warning in check_writeback_specifier()
131 …printf("%hhn", (int*)0); // expected-warning{{format specifies type 'signed char *' but the argume… in check_writeback_specifier()
133 printf("%hn", (short*)0); // no-warning in check_writeback_specifier()
134 printf("%hn", (unsigned short*)0); // no-warning in check_writeback_specifier()
135 …printf("%hn", (int*)0); // expected-warning{{format specifies type 'short *' but the argument has … in check_writeback_specifier()
137 printf("%n", (int*)0); // no-warning in check_writeback_specifier()
138 printf("%n", (unsigned int*)0); // no-warning in check_writeback_specifier()
139 …printf("%n", (char*)0); // expected-warning{{format specifies type 'int *' but the argument has ty… in check_writeback_specifier()
141 printf("%ln", (long*)0); // no-warning in check_writeback_specifier()
142 printf("%ln", (unsigned long*)0); // no-warning in check_writeback_specifier()
143 …printf("%ln", (int*)0); // expected-warning{{format specifies type 'long *' but the argument has t… in check_writeback_specifier()
145 printf("%lln", (long long*)0); // no-warning in check_writeback_specifier()
146 printf("%lln", (unsigned long long*)0); // no-warning in check_writeback_specifier()
147 …printf("%lln", (int*)0); // expected-warning{{format specifies type 'long long *' but the argument… in check_writeback_specifier()
149 printf("%qn", (long long*)0); // no-warning in check_writeback_specifier()
150 printf("%qn", (unsigned long long*)0); // no-warning in check_writeback_specifier()
151 …printf("%qn", (int*)0); // expected-warning{{format specifies type 'long long *' but the argument … in check_writeback_specifier()
153 …printf("%Ln", 0); // expected-warning{{length modifier 'L' results in undefined behavior or no eff… in check_writeback_specifier()
159 printf("%s%lb%d","unix",10,20); // expected-warning {{invalid conversion specifier 'b'}} in check_invalid_specifier()
160 fprintf(fp,"%%%l"); // expected-warning {{incomplete format specifier}} in check_invalid_specifier()
161 …sprintf(buf,"%%%%%ld%d%d", 1, 2, 3); // expected-warning{{format specifies type 'long' but the arg… in check_invalid_specifier()
162 …%ld%;%d", 1, 2, 3); // expected-warning{{format specifies type 'long' but the argument has type 'i… in check_invalid_specifier()
167 printf("\0this is bogus%d",1); // expected-warning {{string contains '\0'}} in check_null_char_string()
168 snprintf(b,10,"%%%%%d\0%d",1,2); // expected-warning {{string contains '\0'}} in check_null_char_string()
169 printf("%\0d",1); // expected-warning {{string contains '\0'}} in check_null_char_string()
176 vprintf("",ap); // expected-warning {{format string is empty}} in check_empty_format_string()
177 sprintf(buf, "", 1); // expected-warning {{format string is empty}} in check_empty_format_string()
182 sprintf(buf, ""); // no-warning in check_empty_format_string()
190 …printf(L"foo %d",2); // expected-warning {{incompatible pointer types}}, expected-warning {{should… in check_wide_string()
191 …vsprintf(b,L"bar %d",ap); // expected-warning {{incompatible pointer types}}, expected-warning {{s… in check_wide_string()
195 …printf("%*d"); // expected-warning {{'*' specified field width is missing a matching 'int' argumen… in check_asterisk_precision_width()
196 …printf("%.*d"); // expected-warning {{'.*' specified field precision is missing a matching 'int' a… in check_asterisk_precision_width()
197 printf("%*d",12,x); // no-warning in check_asterisk_precision_width()
198 …printf("%*d","foo",x); // expected-warning {{field width should have type 'int', but argument has … in check_asterisk_precision_width()
199 …printf("%.*d","foo",x); // expected-warning {{field precision should have type 'int', but argument… in check_asterisk_precision_width()
215 printf(s1); // no-warning in test_constant_bindings()
216 printf(s2); // no-warning in test_constant_bindings()
217 printf(s3); // expected-warning{{not a string literal}} in test_constant_bindings()
219 printf(s4); // expected-warning{{not a string literal}} in test_constant_bindings()
221 printf(s5); // expected-warning{{not a string literal}} in test_constant_bindings()
228 #pragma GCC diagnostic warning "-Wformat-security"
232 printf(P); // expected-warning {{format string is not a string literal (potentially insecure)}} in test9()
238 vprintf ("%*.*d", v8); // no-warning in torture()
243 printf("%s"); // expected-warning{{more '%' conversions than data arguments}} in test10()
244 printf("%@", 12); // expected-warning{{invalid conversion specifier '@'}} in test10()
245 printf("\0"); // expected-warning{{format string contains '\0' within the string body}} in test10()
246 printf("xs\0"); // expected-warning{{format string contains '\0' within the string body}} in test10()
247 …printf("%*d\n"); // expected-warning{{'*' specified field width is missing a matching 'int' argume… in test10()
248 …printf("%*.*d\n", x); // expected-warning{{'.*' specified field precision is missing a matching 'i… in test10()
249 …printf("%*d\n", f, x); // expected-warning{{field width should have type 'int', but argument has t… in test10()
250 …printf("%*.*d\n", x, f, x); // expected-warning{{field precision should have type 'int', but argum… in test10()
251 printf("%**\n"); // expected-warning{{invalid conversion specifier '*'}} in test10()
252 printf("%d%d\n", x); // expected-warning{{more '%' conversions than data arguments}} in test10()
253 printf("%d\n", x, x); // expected-warning{{data argument not used by format string}} in test10()
254 printf("%W%d\n", x, x); // expected-warning{{invalid conversion specifier 'W'}} in test10()
255 printf("%"); // expected-warning{{incomplete format specifier}} in test10()
256 printf("%.d", x); // no-warning in test10()
257 printf("%.", x); // expected-warning{{incomplete format specifier}} in test10()
258 …printf("%f", 4); // expected-warning{{format specifies type 'double' but the argument has type 'in… in test10()
259 printf("%qd", lli); // no-warning in test10()
260 …printf("%qd", x); // expected-warning{{format specifies type 'long long' but the argument has type… in test10()
261 …printf("%qp", (void *)0); // expected-warning{{length modifier 'q' results in undefined behavior o… in test10()
262 printf("hhX %hhX", (unsigned char)10); // no-warning in test10()
263 printf("llX %llX", (long long) 10); // no-warning in test10()
265 printf("%d", (unsigned char) 10); // no-warning in test10()
266 …printf("%d", (long long) 10); // expected-warning{{format specifies type 'int' but the argument ha… in test10()
267 printf("%Lf\n", (long double) 1.0); // no-warning in test10()
268 …printf("%f\n", (long double) 1.0); // expected-warning{{format specifies type 'double' but the arg… in test10()
270 printf("%.0Lf", (long double) 1.0); // no-warning in test10()
271 …printf("%c\n", "x"); // expected-warning{{format specifies type 'int' but the argument has type 'c… in test10()
272 …printf("%c\n", 1.23); // expected-warning{{format specifies type 'int' but the argument has type '… in test10()
273 printf("Format %d, is %! %f", 1, 2, 4.4); // expected-warning{{invalid conversion specifier '!'}} in test10()
279 …printf("%hhu", (short) 10); // expected-warning{{format specifies type 'unsigned char' but the arg… in should_understand_small_integers()
280 …printf("%hu\n", (unsigned char) 1); // expected-warning{{format specifies type 'unsigned short' bu… in should_understand_small_integers()
281 …printf("%hu\n", (uint8_t)1); // expected-warning{{format specifies type 'unsigned short' but the a… in should_understand_small_integers()
285 printf("%p", p); // no-warning in test11()
286 …printf("%p", 123); // expected-warning{{format specifies type 'void *' but the argument has type '… in test11()
287 …printf("%.4p", p); // expected-warning{{precision used with 'p' conversion specifier, resulting in… in test11()
288 …printf("%+p", p); // expected-warning{{flag '+' results in undefined behavior with 'p' conversion … in test11()
289 …printf("% p", p); // expected-warning{{flag ' ' results in undefined behavior with 'p' conversion … in test11()
290 …printf("%0p", p); // expected-warning{{flag '0' results in undefined behavior with 'p' conversion … in test11()
291 printf("%s", s); // no-warning in test11()
292 …printf("%+s", p); // expected-warning{{flag '+' results in undefined behavior with 's' conversion … in test11()
293 …printf("% s", p); // expected-warning{{flag ' ' results in undefined behavior with 's' conversion … in test11()
294 …printf("%0s", p); // expected-warning{{flag '0' results in undefined behavior with 's' conversion … in test11()
299 printf ("%.4s\n", buf); // no-warning in test12()
300 …printf ("%.4s\n", &buf); // expected-warning{{format specifies type 'char *' but the argument has … in test12()
303 …asprintf(&b, "%d", "asprintf"); // expected-warning{{format specifies type 'int' but the argument … in test12()
308 printf("bel: '0%hhd'\n", bel); // no-warning in test13()
309 …printf("x: '0%hhd'\n", x); // expected-warning {{format specifies type 'char' but the argument has… in test13()
317 asl_log(asl, 0, 3, "Error: %m"); // no-warning in test_asl()
318 asl_log(asl, 0, 3, "Error: %W"); // expected-warning{{invalid conversion specifier 'W'}} in test_asl()
329 printf("%S", s); // no-warning in test_unicode_conversions()
330 …printf("%s", s); // expected-warning{{format specifies type 'char *' but the argument has type 'wc… in test_unicode_conversions()
331 printf("%C", s[0]); // no-warning in test_unicode_conversions()
336 printf("%S", "hello"); // expected-warning{{but the argument has type 'char *'}} in test_unicode_conversions()
343 …printf("%0$", (int)2); // expected-warning{{position arguments in format strings start counting at… in test_positional_arguments()
344 …printf("%1$*0$d", (int) 2); // expected-warning{{position arguments in format strings start counti… in test_positional_arguments()
345 printf("%1$d", (int) 2); // no-warning in test_positional_arguments()
346 printf("%1$d", (int) 2, 2); // expected-warning{{data argument not used by format string}} in test_positional_arguments()
347 …printf("%1$d%1$f", (int) 2); // expected-warning{{format specifies type 'double' but the argument … in test_positional_arguments()
348 printf("%1$2.2d", (int) 2); // no-warning in test_positional_arguments()
349 printf("%2$*1$.2d", (int) 2, (int) 3); // no-warning in test_positional_arguments()
350 …printf("%2$*8$d", (int) 2, (int) 3); // expected-warning{{specified field width is missing a match… in test_positional_arguments()
351 printf("%%%1$d", (int) 2); // no-warning in test_positional_arguments()
352 printf("%1$d%%", (int) 2); // no-warning in test_positional_arguments()
358 myprintf_PR_6697("%s\n", 1, "foo"); // no-warning in test_pr_6697()
359 …myprintf_PR_6697("%s\n", 1, (int)0); // expected-warning{{format specifies type 'char *' but the a… in test_pr_6697()
362 myprintf_PR_6697("%1$s\n", 1, "foo"); // no-warning in test_pr_6697()
363 …myprintf_PR_6697("%2$s\n", 1, "foo"); // expected-warning{{data argument position '2' exceeds the … in test_pr_6697()
364 …myprintf_PR_6697("%18$s\n", 1, "foo"); // expected-warning{{data argument position '18' exceeds th… in test_pr_6697()
365 …myprintf_PR_6697("%1$s\n", 1, (int) 0); // expected-warning{{format specifies type 'char *' but th… in test_pr_6697()
369 fprintf(fp, "\%"); // expected-warning{{incomplete format specifier}} in rdar8026030()
374 …printf("%hhs", "foo"); // expected-warning{{length modifier 'hh' results in undefined behavior or … in bug7377_bad_length_mod_usage()
375 …printf("%1$zp", (void *)0); // expected-warning{{length modifier 'z' results in undefined behavior… in bug7377_bad_length_mod_usage()
376 printf("%ls", L"foo"); // no-warning in bug7377_bad_length_mod_usage()
377 printf("%#.2Lf", (long double)1.234); // no-warning in bug7377_bad_length_mod_usage()
380 …printf("%#p", (void *) 0); // expected-warning{{flag '#' results in undefined behavior with 'p' co… in bug7377_bad_length_mod_usage()
381 printf("%0d", -1); // no-warning in bug7377_bad_length_mod_usage()
382 …printf("%#n", (int *) 0); // expected-warning{{flag '#' results in undefined behavior with 'n' con… in bug7377_bad_length_mod_usage()
383 …printf("%-n", (int *) 0); // expected-warning{{flag '-' results in undefined behavior with 'n' con… in bug7377_bad_length_mod_usage()
384 printf("%-p", (void *) 0); // no-warning in bug7377_bad_length_mod_usage()
387 …printf("%.2c", 'a'); // expected-warning{{precision used with 'c' conversion specifier, resulting … in bug7377_bad_length_mod_usage()
388 …printf("%1n", (int *) 0); // expected-warning{{field width used with 'n' conversion specifier, res… in bug7377_bad_length_mod_usage()
389 …printf("%.9n", (int *) 0); // expected-warning{{precision used with 'n' conversion specifier, resu… in bug7377_bad_length_mod_usage()
392 printf("% +f", 1.23); // expected-warning{{flag ' ' is ignored when flag '+' is present}} in bug7377_bad_length_mod_usage()
393 printf("%+ f", 1.23); // expected-warning{{flag ' ' is ignored when flag '+' is present}} in bug7377_bad_length_mod_usage()
394 printf("%0-f", 1.23); // expected-warning{{flag '0' is ignored when flag '-' is present}} in bug7377_bad_length_mod_usage()
395 printf("%-0f", 1.23); // expected-warning{{flag '0' is ignored when flag '-' is present}} in bug7377_bad_length_mod_usage()
396 printf("%-+f", 1.23); // no-warning in bug7377_bad_length_mod_usage()
402 printf("%lc", c); // no-warning in pr7981()
403 printf("%lc", 1.0); // expected-warning{{the argument has type 'double'}} in pr7981()
404 printf("%lc", (char) 1); // no-warning in pr7981()
405 printf("%lc", &c); // expected-warning{{the argument has type 'wint_t *'}} in pr7981()
410 printf("%lc", c2); // no-warning in pr7981()
418 printf(0); // no-warning in rdar8269537()
427 rdar8332221_vprintf_scanf("%", ap, "%d", x); // expected-warning{{incomplete format specifier}} in rdar8332221()
439 printf("%'d\n", 123456789); // no-warning in posix_extensions()
440 printf("%'i\n", 123456789); // no-warning in posix_extensions()
441 printf("%'f\n", (float) 1.0); // no-warning in posix_extensions()
442 …printf("%'p\n", (void*) 0); // expected-warning{{results in undefined behavior with 'p' conversion… in posix_extensions()
448 #pragma GCC diagnostic warning "-Wformat"
452 …printf("%s", 1); // expected-warning{{format specifies type 'char *' but the argument has type 'in… in pr8486()
458 printf(__PRETTY_FUNCTION__); // no-warning in pr9314()
459 printf(__func__); // no-warning in pr9314()
465 …printf("%s", 2); // expected-warning{{format specifies type 'char *' but the argument has type 'in… in rdar9612060()
469 printf("%c", y); // no-warning in check_char()
470 printf("%hhu", x); // no-warning in check_char()
471 printf("%hhi", y); // no-warning in check_char()
472 printf("%hhi", x); // no-warning in check_char()
473 printf("%c", x); // no-warning in check_char()
474 printf("%hhu", y); // no-warning in check_char()
482 printf("%@", 12); // no-warning in test_suppress_invalid_specifier()
487 #pragma GCC diagnostic warning "-Wformat"
488 #pragma GCC diagnostic warning "-Wformat-security"
490 // Test that the printf call site is where the warning is attached. If the
494 printf(kFormat1, 0); // expected-warning{{more '%' conversions than data arguments}} in pr9751()
495 printf("%d %s\n", 0); // expected-warning{{more '%' conversions than data arguments}} in pr9751()
498 …printf(kFormat2, 1, "foo"); // expected-warning{{data argument position '18' exceeds the number of… in pr9751()
499 …printf("%18$s\n", 1, "foo"); // expected-warning{{data argument position '18' exceeds the number o… in pr9751()
502 printf(kFormat4, 5); // expected-warning{{invalid conversion specifier 'y'}} in pr9751()
503 printf("%y", 5); // expected-warning{{invalid conversion specifier 'y'}} in pr9751()
506 printf(kFormat5, 5); // expected-warning{{incomplete format specifier}} in pr9751()
507 printf("%.", 5); // expected-warning{{incomplete format specifier}} in pr9751()
510 …printf(kFormat6, 5); // expected-warning{{format specifies type 'char *' but the argument has type… in pr9751()
511 …printf("%s", 5); // expected-warning{{format specifies type 'char *' but the argument has type 'in… in pr9751()
514 …printf(kFormat7, 5); // expected-warning{{position arguments in format strings start counting at 1… in pr9751()
515 …printf("%0$", 5); // expected-warning{{position arguments in format strings start counting at 1 (n… in pr9751()
518 …printf(kFormat8, 4, 4); // expected-warning{{cannot mix positional and non-positional arguments in… in pr9751()
519 …printf("%1$d %d", 4, 4); // expected-warning{{cannot mix positional and non-positional arguments i… in pr9751()
522 printf(kFormat9, 4, 4); // expected-warning{{format string is empty}} in pr9751()
523 printf("", 4, 4); // expected-warning{{format string is empty}} in pr9751()
526 printf(kFormat10, 4); // expected-warning{{format string contains '\0' within the string body}} in pr9751()
527 printf("\0%d", 4); // expected-warning{{format string contains '\0' within the string body}} in pr9751()
530 …printf(kFormat11); // expected-warning{{'*' specified field width is missing a matching 'int' argu… in pr9751()
531 …printf("%*d"); // expected-warning{{'*' specified field width is missing a matching 'int' argument… in pr9751()
534 …printf(kFormat12, 4.4); // expected-warning{{field width should have type 'int', but argument has … in pr9751()
535 …printf("%*d", 4.4); // expected-warning{{field width should have type 'int', but argument has type… in pr9751()
539 …printf(kFormat13, p); // expected-warning{{precision used with 'p' conversion specifier, resulting… in pr9751()
540 …printf("%.3p", p); // expected-warning{{precision used with 'p' conversion specifier, resulting in… in pr9751()
543 …printf(kFormat14, "a"); // expected-warning{{flag '0' results in undefined behavior with 's' conve… in pr9751()
544 …printf("%0s", "a"); // expected-warning{{flag '0' results in undefined behavior with 's' conversio… in pr9751()
547 …printf(kFormat15, "a"); // expected-warning{{length modifier 'hh' results in undefined behavior or… in pr9751()
548 …printf("%hhs", "a"); // expected-warning{{length modifier 'hh' results in undefined behavior or no… in pr9751()
551 printf(kFormat16, 5); // expected-warning{{flag '0' is ignored when flag '-' is present}} in pr9751()
552 printf("%-0d", 5); // expected-warning{{flag '0' is ignored when flag '-' is present}} in pr9751()
556 printf(1 ? "yes %d" : "no %d"); // expected-warning{{more '%' conversions than data arguments}} in pr9751()
559 …printf(kFormat17, (int[]){0}); // expected-warning{{format specifies type 'unsigned short' but the… in pr9751()
561 …printf("%a", (long double)0); // expected-warning{{format specifies type 'double' but the argument… in pr9751()
565 printf(kFormat18, 0); // expected-warning{{format specifies type}} in pr9751()
570 0.0); // expected-warning{{format specifies}} in pr9751()
576 const char s3[2] = "s\0%s"; // expected-warning{{initializer-string for char array is too long}} in pr18905()
578 const char s5[0] = "%s"; // expected-warning{{initializer-string for char array is too long}} in pr18905()
581 printf(s1); // expected-warning{{format string contains '\0' within the string body}} in pr18905()
582 printf(s2); // expected-warning{{format string is not null-terminated}} in pr18905()
583 printf(s3); // no-warning in pr18905()
584 printf(s4); // no-warning in pr18905()
585 printf(s5); // expected-warning{{format string is not null-terminated}} in pr18905()
594 monformat("", 1); // expected-warning{{format string is empty}} in test_other_formats()
595 …monformat(str); // expected-warning{{format string is not a string literal (potentially insecure)}} in test_other_formats()
596 dateformat(""); // expected-warning{{format string is empty}} in test_other_formats()
597 dateformat(str); // no-warning (using strftime non-literal is not unsafe) in test_other_formats()
604 PRINT1("%d\n", x); // no-warning{{extra argument is system header is OK}} in test_unused_system_args()
625 test14_foo("%", "%d", p); // expected-warning{{incomplete format specifier}} in test14_zed()
626 test14_bar("%", "%d", p); // expected-warning{{incomplete format specifier}} in test14_zed()
631 …printf("%n", cip); // expected-warning{{format specifies type 'int *' but the argument has type 'c… in test_qualifiers()
632 …printf("%n", cvip); // expected-warning{{format specifies type 'int *' but the argument has type '… in test_qualifiers()
634 printf("%n", vip); // No warning. in test_qualifiers()
635 printf("%p", cip); // No warning. in test_qualifiers()
636 printf("%p", cvip); // No warning. in test_qualifiers()
641 printf("%n", (ip_t)0); // No warning. in test_qualifiers()
642 …printf("%n", (cip_t)0); // expected-warning{{format specifies type 'int *' but the argument has ty… in test_qualifiers()
646 #pragma GCC diagnostic warning "-Wformat-security"
651 …test_format_security_extra_args(string, 5); // expected-warning {{format string is not a string li… in test_format_security_pos()
654 #pragma GCC diagnostic warning "-Wformat-nonliteral"