Lines Matching full:printf

13 int printf(const char *restrict, ...); // expected-note{{passing argument to parameter here}}
33 printf(s); // expected-warning {{format string is not a string literal}} in check_string_literal()
59 printf(fmt, 1, 2); // expected-warning{{data argument not used}} in check_string_literal()
61 printf("abc" in check_string_literal()
63 printf("abc\ in check_string_literal()
70 printf("%*d", (unsigned) 1, 1); // no-warning in check_string_literal()
82 printf(s); // expected-warning {{format string is not a string literal}} in check_string_literal2()
101 printf(i == 1 ? "yes" : "no"); // no-warning in check_conditional_literal()
102 printf(i == 0 ? (i == 1 ? "yes" : "no") : "dont know"); // no-warning in check_conditional_literal()
103printf(i == 0 ? (i == 1 ? s : "no") : "dont know"); // expected-warning{{format string is not a st… in check_conditional_literal()
105 printf("yes" ?: "no %d", 1); // expected-warning{{data argument not used by format string}} in check_conditional_literal()
106 printf(0 ? "yes %s" : "no %d", 1); // no-warning in check_conditional_literal()
107 printf(0 ? "yes %d" : "no %s", 1); // expected-warning{{format specifies type 'char *'}} in check_conditional_literal()
109 printf(0 ? "yes" : "no %d", 1); // no-warning in check_conditional_literal()
110 printf(0 ? "yes %d" : "no", 1); // expected-warning{{data argument not used by format string}} in check_conditional_literal()
111 printf(1 ? "yes" : "no %d", 1); // expected-warning{{data argument not used by format string}} in check_conditional_literal()
112 printf(1 ? "yes %d" : "no", 1); // no-warning in check_conditional_literal()
113 printf(i ? "yes" : "no %d", 1); // no-warning in check_conditional_literal()
114 printf(i ? "yes %s" : "no %d", 1); // expected-warning{{format specifies type 'char *'}} in check_conditional_literal()
115 printf(i ? "yes" : "no %d", 1, 2); // expected-warning{{data argument not used by format string}} in check_conditional_literal()
117 printf(i ? "%*s" : "-", i, s); // no-warning in check_conditional_literal()
118printf(i ? "yes" : 0 ? "no %*d" : "dont know %d", 1, 2); // expected-warning{{data argument not us… in check_conditional_literal()
119printf(i ? "%i\n" : "%i %s %s\n", i, s); // expected-warning{{more '%' conversions than data argum… in check_conditional_literal()
128printf("%n", b); // expected-warning{{format specifies type 'int *' but the argument has type 'cha… in check_writeback_specifier()
129 printf("%n", &x); // no-warning in check_writeback_specifier()
131 printf("%hhn", (signed char*)0); // no-warning in check_writeback_specifier()
132 printf("%hhn", (char*)0); // no-warning in check_writeback_specifier()
133 printf("%hhn", (unsigned char*)0); // no-warning in check_writeback_specifier()
134printf("%hhn", (int*)0); // expected-warning{{format specifies type 'signed char *' but the argume… in check_writeback_specifier()
136 printf("%hn", (short*)0); // no-warning in check_writeback_specifier()
137 printf("%hn", (unsigned short*)0); // no-warning in check_writeback_specifier()
138printf("%hn", (int*)0); // expected-warning{{format specifies type 'short *' but the argument has … in check_writeback_specifier()
140 printf("%n", (int*)0); // no-warning in check_writeback_specifier()
141 printf("%n", (unsigned int*)0); // no-warning in check_writeback_specifier()
142printf("%n", (char*)0); // expected-warning{{format specifies type 'int *' but the argument has ty… in check_writeback_specifier()
144 printf("%ln", (long*)0); // no-warning in check_writeback_specifier()
145 printf("%ln", (unsigned long*)0); // no-warning in check_writeback_specifier()
146printf("%ln", (int*)0); // expected-warning{{format specifies type 'long *' but the argument has t… in check_writeback_specifier()
148 printf("%lln", (long long*)0); // no-warning in check_writeback_specifier()
149 printf("%lln", (unsigned long long*)0); // no-warning in check_writeback_specifier()
150printf("%lln", (int*)0); // expected-warning{{format specifies type 'long long *' but the argument… in check_writeback_specifier()
152 printf("%qn", (long long*)0); // no-warning in check_writeback_specifier()
153 printf("%qn", (unsigned long long*)0); // no-warning in check_writeback_specifier()
154printf("%qn", (int*)0); // expected-warning{{format specifies type 'long long *' but the argument … in check_writeback_specifier()
156printf("%Ln", 0); // expected-warning{{length modifier 'L' results in undefined behavior or no eff… in check_writeback_specifier()
165 printf("%n", &x); // expected-warning{{'%n' specifier not supported on this platform}} in check_writeback_specifier()
167printf("%hhn", (signed char*)0); // expected-warning{{'%n' specifier not supported on this platfor… in check_writeback_specifier()
168 printf("%hhn", (char*)0); // expected-warning{{'%n' specifier not supported on this platform}} in check_writeback_specifier()
169printf("%hhn", (unsigned char*)0); // expected-warning{{'%n' specifier not supported on this platf… in check_writeback_specifier()
170printf("%hhn", (int*)0); // expected-warning{{format specifies type 'signed char *' but the argume… in check_writeback_specifier()
173 printf("%hn", (short*)0); // expected-warning{{'%n' specifier not supported on this platform}} in check_writeback_specifier()
174printf("%hn", (unsigned short*)0); // expected-warning{{'%n' specifier not supported on this platf… in check_writeback_specifier()
175printf("%hn", (int*)0); // expected-warning{{format specifies type 'short *' but the argument has … in check_writeback_specifier()
178 printf("%n", (int*)0); // expected-warning{{'%n' specifier not supported on this platform}} in check_writeback_specifier()
179printf("%n", (unsigned int*)0); // expected-warning{{'%n' specifier not supported on this platform… in check_writeback_specifier()
180printf("%n", (char*)0); // expected-warning{{format specifies type 'int *' but the argument has ty… in check_writeback_specifier()
183 printf("%ln", (long*)0); // expected-warning{{'%n' specifier not supported on this platform}} in check_writeback_specifier()
184printf("%ln", (unsigned long*)0); // expected-warning{{'%n' specifier not supported on this platfo… in check_writeback_specifier()
185printf("%ln", (int*)0); // expected-warning{{format specifies type 'long *' but the argument has t… in check_writeback_specifier()
188printf("%lln", (long long*)0); // expected-warning{{'%n' specifier not supported on this platform}} in check_writeback_specifier()
189printf("%lln", (unsigned long long*)0); // expected-warning{{'%n' specifier not supported on this … in check_writeback_specifier()
190printf("%lln", (int*)0); // expected-warning{{format specifies type 'long long *' but the argument… in check_writeback_specifier()
193 printf("%qn", (long long*)0); // expected-warning{{'%n' specifier not supported on this platform}} in check_writeback_specifier()
194printf("%qn", (unsigned long long*)0); // expected-warning{{'%n' specifier not supported on this p… in check_writeback_specifier()
201printf("%s%lv%d","unix",10,20); // expected-warning {{invalid conversion specifier 'v'}} expected-… in check_invalid_specifier()
210 printf("\0this is bogus%d",1); // expected-warning {{string contains '\0'}} in check_null_char_string()
212 printf("%\0d",1); // expected-warning {{string contains '\0'}} in check_null_char_string()
233printf(L"foo %d",2); // expected-warning {{incompatible pointer types}}, expected-warning {{should… in check_wide_string()
238printf("%*d"); // expected-warning {{'*' specified field width is missing a matching 'int' argumen… in check_asterisk_precision_width()
239printf("%.*d"); // expected-warning {{'.*' specified field precision is missing a matching 'int' a… in check_asterisk_precision_width()
240 printf("%*d",12,x); // no-warning in check_asterisk_precision_width()
241printf("%*d","foo",x); // expected-warning {{field width should have type 'int', but argument has … in check_asterisk_precision_width()
242printf("%.*d","foo",x); // expected-warning {{field precision should have type 'int', but argument… in check_asterisk_precision_width()
245 void __attribute__((format(printf,1,3))) myprintf(const char*, int blah, ...);
258 printf(s1); // no-warning in test_constant_bindings()
259 printf(s2); // no-warning in test_constant_bindings()
260 printf(s3); // expected-warning{{not a string literal}} in test_constant_bindings()
262 printf(s4); // expected-warning{{not a string literal}} in test_constant_bindings()
264 printf(s5); // expected-warning{{not a string literal}} in test_constant_bindings()
275 printf(P); // expected-warning {{format string is not a string literal (potentially insecure)}} in test9()
277 printf(P, 42); in test9()
286 printf("%s"); // expected-warning{{more '%' conversions than data arguments}} in test10()
287 printf("%@", 12); // expected-warning{{invalid conversion specifier '@'}} in test10()
288 printf("\0"); // expected-warning{{format string contains '\0' within the string body}} in test10()
289 printf("xs\0"); // expected-warning{{format string contains '\0' within the string body}} in test10()
290printf("%*d\n"); // expected-warning{{'*' specified field width is missing a matching 'int' argume… in test10()
291printf("%*.*d\n", x); // expected-warning{{'.*' specified field precision is missing a matching 'i… in test10()
292printf("%*d\n", f, x); // expected-warning{{field width should have type 'int', but argument has t… in test10()
293printf("%*.*d\n", x, f, x); // expected-warning{{field precision should have type 'int', but argum… in test10()
294 printf("%**\n"); // expected-warning{{invalid conversion specifier '*'}} in test10()
295 printf("%d%d\n", x); // expected-warning{{more '%' conversions than data arguments}} in test10()
296 printf("%d\n", x, x); // expected-warning{{data argument not used by format string}} in test10()
297printf("%W%d\n", x, x); // expected-warning{{invalid conversion specifier 'W'}} expected-warning … in test10()
298 printf("%"); // expected-warning{{incomplete format specifier}} in test10()
299 printf("%.d", x); // no-warning in test10()
300 printf("%.", x); // expected-warning{{incomplete format specifier}} in test10()
301printf("%f", 4); // expected-warning{{format specifies type 'double' but the argument has type 'in… in test10()
302 printf("%qd", lli); // no-warning in test10()
303printf("%qd", x); // expected-warning{{format specifies type 'long long' but the argument has type… in test10()
304printf("%qp", (void *)0); // expected-warning{{length modifier 'q' results in undefined behavior o… in test10()
305 printf("hhX %hhX", (unsigned char)10); // no-warning in test10()
306 printf("llX %llX", (long long) 10); // no-warning in test10()
307 printf("%lb %lB", (long) 10, (long) 10); // no-warning in test10()
308 printf("%llb %llB", (long long) 10, (long long) 10); // no-warning in test10()
310 printf("%d", (unsigned char) 10); // no-warning in test10()
311printf("%d", (long long) 10); // expected-warning{{format specifies type 'int' but the argument ha… in test10()
312 printf("%Lf\n", (long double) 1.0); // no-warning in test10()
313printf("%f\n", (long double) 1.0); // expected-warning{{format specifies type 'double' but the arg… in test10()
315 printf("%.0Lf", (long double) 1.0); // no-warning in test10()
316printf("%c\n", "x"); // expected-warning{{format specifies type 'int' but the argument has type 'c… in test10()
317printf("%c\n", 1.23); // expected-warning{{format specifies type 'int' but the argument has type '… in test10()
318 printf("Format %d, is %! %f", 1, 4.4); // expected-warning{{invalid conversion specifier '!'}} in test10()
324printf("%hhu", (short) 10); // expected-warning{{format specifies type 'unsigned char' but the arg… in should_understand_small_integers()
325 printf("%hu\n", (unsigned char)1); // warning with -Wformat-pedantic only in should_understand_small_integers()
326 printf("%hu\n", (uint8_t)1); // warning with -Wformat-pedantic only in should_understand_small_integers()
330 printf("%p", p); // no-warning in test11()
331printf("%p", 123); // expected-warning{{format specifies type 'void *' but the argument has type '… in test11()
332printf("%.4p", p); // expected-warning{{precision used with 'p' conversion specifier, resulting in… in test11()
333printf("%+p", p); // expected-warning{{flag '+' results in undefined behavior with 'p' conversion … in test11()
334printf("% p", p); // expected-warning{{flag ' ' results in undefined behavior with 'p' conversion … in test11()
335printf("%0p", p); // expected-warning{{flag '0' results in undefined behavior with 'p' conversion … in test11()
336 printf("%s", s); // no-warning in test11()
337printf("%+s", p); // expected-warning{{flag '+' results in undefined behavior with 's' conversion … in test11()
339printf("% s", p); // expected-warning{{flag ' ' results in undefined behavior with 's' conversion … in test11()
341printf("%0s", p); // expected-warning{{flag '0' results in undefined behavior with 's' conversion … in test11()
347 printf ("%.4s\n", buf); // no-warning in test12()
348printf ("%.4s\n", &buf); // expected-warning{{format specifies type 'char *' but the argument has … in test12()
356 printf("bel: '0%hhd'\n", bel); // no-warning in test13()
357printf("x: '0%hhd'\n", x); // expected-warning {{format specifies type 'char' but the argument has… in test13()
369 void f0(int_t x) { printf("%d\n", x); } in f0()
375 printf("%S", s); // no-warning in test_unicode_conversions()
376printf("%s", s); // expected-warning{{format specifies type 'char *' but the argument has type 'wc… in test_unicode_conversions()
377 printf("%C", s[0]); // no-warning in test_unicode_conversions()
379printf("%c", s[0]); // expected-warning{{format specifies type 'int' but the argument has type 'wc… in test_unicode_conversions()
381 printf("%c", s[0]); in test_unicode_conversions()
385 // printf("%C", 10); in test_unicode_conversions()
386 printf("%S", "hello"); // expected-warning{{but the argument has type 'char *'}} in test_unicode_conversions()
393printf("%0$", (int)2); // expected-warning{{position arguments in format strings start counting at… in test_positional_arguments()
394printf("%1$*0$d", (int) 2); // expected-warning{{position arguments in format strings start counti… in test_positional_arguments()
395 printf("%1$d", (int) 2); // no-warning in test_positional_arguments()
396 printf("%1$d", (int) 2, 2); // expected-warning{{data argument not used by format string}} in test_positional_arguments()
397printf("%1$d%1$f", (int) 2); // expected-warning{{format specifies type 'double' but the argument … in test_positional_arguments()
398 printf("%1$2.2d", (int) 2); // no-warning in test_positional_arguments()
399 printf("%2$*1$.2d", (int) 2, (int) 3); // no-warning in test_positional_arguments()
400printf("%2$*8$d", (int) 2, (int) 3); // expected-warning{{specified field width is missing a match… in test_positional_arguments()
401 printf("%%%1$d", (int) 2); // no-warning in test_positional_arguments()
402 printf("%1$d%%", (int) 2); // no-warning in test_positional_arguments()
406 void myprintf_PR_6697(const char *format, int x, ...) __attribute__((__format__(printf,1, 3)));
424printf("%hhs", "foo"); // expected-warning{{length modifier 'hh' results in undefined behavior or … in bug7377_bad_length_mod_usage()
425printf("%1$zp", (void *)0); // expected-warning{{length modifier 'z' results in undefined behavior… in bug7377_bad_length_mod_usage()
426 printf("%ls", L"foo"); // no-warning in bug7377_bad_length_mod_usage()
427 printf("%#.2Lf", (long double)1.234); // no-warning in bug7377_bad_length_mod_usage()
430printf("%#p", (void *) 0); // expected-warning{{flag '#' results in undefined behavior with 'p' co… in bug7377_bad_length_mod_usage()
431 printf("%0d", -1); // no-warning in bug7377_bad_length_mod_usage()
432 printf("%0b%0B", -1u, -1u); // no-warning in bug7377_bad_length_mod_usage()
433 printf("%-p", (void *) 0); // no-warning in bug7377_bad_length_mod_usage()
435printf("%#n", (int *) 0); // expected-warning{{flag '#' results in undefined behavior with 'n' con… in bug7377_bad_length_mod_usage()
436printf("%-n", (int *) 0); // expected-warning{{flag '-' results in undefined behavior with 'n' con… in bug7377_bad_length_mod_usage()
438printf("%#n", (int *) 0); // expected-warning{{flag '#' results in undefined behavior with 'n' con… in bug7377_bad_length_mod_usage()
440printf("%-n", (int *) 0); // expected-warning{{flag '-' results in undefined behavior with 'n' con… in bug7377_bad_length_mod_usage()
445printf("%.2c", 'a'); // expected-warning{{precision used with 'c' conversion specifier, resulting … in bug7377_bad_length_mod_usage()
447printf("%1n", (int *) 0); // expected-warning{{field width used with 'n' conversion specifier, res… in bug7377_bad_length_mod_usage()
448printf("%.9n", (int *) 0); // expected-warning{{precision used with 'n' conversion specifier, resu… in bug7377_bad_length_mod_usage()
450printf("%1n", (int *) 0); // expected-warning{{field width used with 'n' conversion specifier, res… in bug7377_bad_length_mod_usage()
452printf("%.9n", (int *) 0); // expected-warning{{precision used with 'n' conversion specifier, resu… in bug7377_bad_length_mod_usage()
457 printf("% +f", 1.23); // expected-warning{{flag ' ' is ignored when flag '+' is present}} in bug7377_bad_length_mod_usage()
458 printf("%+ f", 1.23); // expected-warning{{flag ' ' is ignored when flag '+' is present}} in bug7377_bad_length_mod_usage()
459 printf("%0-f", 1.23); // expected-warning{{flag '0' is ignored when flag '-' is present}} in bug7377_bad_length_mod_usage()
460 printf("%-0f", 1.23); // expected-warning{{flag '0' is ignored when flag '-' is present}} in bug7377_bad_length_mod_usage()
461 printf("%-+f", 1.23); // no-warning in bug7377_bad_length_mod_usage()
467 printf("%lc", c); // no-warning in pr7981()
468 printf("%lc", 1.0); // expected-warning{{the argument has type 'double'}} in pr7981()
470 printf("%lc", (char) 1); // no-warning in pr7981()
472 printf("%lc", (char) 1); // expected-warning{{the argument has type 'char'}} in pr7981()
474 printf("%lc", &c); // expected-warning{{the argument has type 'wint_t *'}} in pr7981()
479 printf("%lc", c2); // no-warning in pr7981()
487 printf(0); // no-warning in rdar8269537()
501 printf("%#x\n", 10); in pr8641()
502 printf("%#X\n", 10); in pr8641()
503 printf("%#b %#15.8B\n", 10, 10u); in pr8641()
508 printf("%'d\n", 123456789); // no-warning in posix_extensions()
509 printf("%'i\n", 123456789); // no-warning in posix_extensions()
510 printf("%'f\n", (float) 1.0); // no-warning in posix_extensions()
511printf("%'p\n", (void*) 0); // expected-warning{{results in undefined behavior with 'p' conversion… in posix_extensions()
512printf("%'b\n", 123456789); // expected-warning{{results in undefined behavior with 'b' conversion… in posix_extensions()
513printf("%'B\n", 123456789); // expected-warning{{results in undefined behavior with 'B' conversion… in posix_extensions()
523printf("%s", 1); // expected-warning{{format specifies type 'char *' but the argument has type 'in… in pr8486()
529 printf(__PRETTY_FUNCTION__); // no-warning in pr9314()
530 printf(__func__); // no-warning in pr9314()
533 int printf(const char * restrict, ...) __attribute__((__format__ (__printf__, 1, 2)));
536printf("%s", 2); // expected-warning{{format specifies type 'char *' but the argument has type 'in… in rdar9612060()
540 printf("%c", y); // no-warning in check_char()
541 printf("%hhu", x); // no-warning in check_char()
542 printf("%hhi", y); // no-warning in check_char()
543 printf("%hhi", x); // no-warning in check_char()
544 printf("%c", x); // no-warning in check_char()
545 printf("%hhu", y); // no-warning in check_char()
546 printf("%hhb %hhB", x, x); // no-warning in check_char()
554 printf("%@", 12); // no-warning in test_suppress_invalid_specifier()
562 // Test that the printf call site is where the warning is attached. If the
566 printf(kFormat1, 0); // expected-warning{{more '%' conversions than data arguments}} in pr9751()
567 printf("%d %s\n", 0); // expected-warning{{more '%' conversions than data arguments}} in pr9751()
570printf(kFormat2, 1, "foo"); // expected-warning{{data argument position '18' exceeds the number of… in pr9751()
571printf("%18$s\n", 1, "foo"); // expected-warning{{data argument position '18' exceeds the number o… in pr9751()
574 printf(kFormat4, 5); // expected-warning{{invalid conversion specifier 'y'}} in pr9751()
575 printf("%y", 5); // expected-warning{{invalid conversion specifier 'y'}} in pr9751()
578 printf(kFormat5, 5); // expected-warning{{incomplete format specifier}} in pr9751()
579 printf("%.", 5); // expected-warning{{incomplete format specifier}} in pr9751()
582printf(kFormat6, 5); // expected-warning{{format specifies type 'char *' but the argument has type… in pr9751()
583printf("%s", 5); // expected-warning{{format specifies type 'char *' but the argument has type 'in… in pr9751()
586printf(kFormat7, 5); // expected-warning{{position arguments in format strings start counting at 1… in pr9751()
587printf("%0$", 5); // expected-warning{{position arguments in format strings start counting at 1 (n… in pr9751()
590printf(kFormat8, 4, 4); // expected-warning{{cannot mix positional and non-positional arguments in… in pr9751()
591printf("%1$d %d", 4, 4); // expected-warning{{cannot mix positional and non-positional arguments i… in pr9751()
594 printf(kFormat9, 4, 4); // expected-warning{{format string is empty}} in pr9751()
595 printf("", 4, 4); // expected-warning{{format string is empty}} in pr9751()
598 printf(kFormat10, 4); // expected-warning{{format string contains '\0' within the string body}} in pr9751()
599 printf("\0%d", 4); // expected-warning{{format string contains '\0' within the string body}} in pr9751()
602printf(kFormat11); // expected-warning{{'*' specified field width is missing a matching 'int' argu… in pr9751()
603printf("%*d"); // expected-warning{{'*' specified field width is missing a matching 'int' argument… in pr9751()
606printf(kFormat12, 4.4); // expected-warning{{field width should have type 'int', but argument has … in pr9751()
607printf("%*d", 4.4); // expected-warning{{field width should have type 'int', but argument has type… in pr9751()
611printf(kFormat13, p); // expected-warning{{precision used with 'p' conversion specifier, resulting… in pr9751()
612printf("%.3p", p); // expected-warning{{precision used with 'p' conversion specifier, resulting in… in pr9751()
615printf(kFormat14, "a"); // expected-warning{{flag '0' results in undefined behavior with 's' conve… in pr9751()
616printf("%0s", "a"); // expected-warning{{flag '0' results in undefined behavior with 's' conversio… in pr9751()
619printf(kFormat15, "a"); // expected-warning{{length modifier 'hh' results in undefined behavior or… in pr9751()
620printf("%hhs", "a"); // expected-warning{{length modifier 'hh' results in undefined behavior or no… in pr9751()
623 printf(kFormat16, 5); // expected-warning{{flag '0' is ignored when flag '-' is present}} in pr9751()
624 printf("%-0d", 5); // expected-warning{{flag '0' is ignored when flag '-' is present}} in pr9751()
628 printf(1 ? "yes %d" : "no %d"); // expected-warning{{more '%' conversions than data arguments}} in pr9751()
631printf(kFormat17, (int[]){0}); // expected-warning{{format specifies type 'unsigned short' but the… in pr9751()
633printf("%a", (long double)0); // expected-warning{{format specifies type 'double' but the argument… in pr9751()
637 printf(kFormat18, 0); // expected-warning{{format specifies type}} in pr9751()
641 printf(kFormat19, in pr9751()
653 printf(s1); // expected-warning{{format string contains '\0' within the string body}} in pr18905()
654 printf(s2); // expected-warning{{format string is not null-terminated}} in pr18905()
655 printf(s3); // no-warning in pr18905()
656 printf(s4); // no-warning in pr18905()
657 printf(s5); // expected-warning{{format string is not null-terminated}} in pr18905()
680 printf("%hhx", c); in pr12761()
684 printf("%v4d", x); // expected-warning{{invalid conversion specifier 'v'}} in test_opencl_vector_format()
685 printf("%vd", x); // expected-warning{{invalid conversion specifier 'v'}} in test_opencl_vector_format()
686 printf("%0vd", x); // expected-warning{{invalid conversion specifier 'v'}} in test_opencl_vector_format()
687 printf("%hlf", x); // expected-warning{{invalid conversion specifier 'l'}} in test_opencl_vector_format()
688 printf("%hld", x); // expected-warning{{invalid conversion specifier 'l'}} in test_opencl_vector_format()
711printf("%n", cip); // expected-warning{{format specifies type 'int *' but the argument has type 'c… in test_qualifiers()
712printf("%n", cvip); // expected-warning{{format specifies type 'int *' but the argument has type '… in test_qualifiers()
714 printf("%n", vip); // No warning. in test_qualifiers()
715 printf("%p", cip); // No warning. in test_qualifiers()
716 printf("%p", cvip); // No warning. in test_qualifiers()
721 printf("%n", (ip_t)0); // No warning. in test_qualifiers()
722printf("%n", (cip_t)0); // expected-warning{{format specifies type 'int *' but the argument has ty… in test_qualifiers()
729printf("%n", cip); // expected-warning{{format specifies type 'int *' but the argument has type 'c… in test_qualifiers()
731printf("%n", cvip); // expected-warning{{format specifies type 'int *' but the argument has type '… in test_qualifiers()
734 printf("%n", vip); // expected-warning{{'%n' specifier not supported on this platform}} in test_qualifiers()
735 printf("%p", cip); // No warning. in test_qualifiers()
736 printf("%p", cvip); // No warning. in test_qualifiers()
741 printf("%n", (ip_t)0); // expected-warning{{'%n' specifier not supported on this platform}} in test_qualifiers()
742printf("%n", (cip_t)0); // expected-warning{{format specifies type 'int *' but the argument has ty… in test_qualifiers()
762printf(s1 - 1); // expected-warning {{format string is not a string literal (potentially insecure… in test_char_pointer_arithmetic()
765 printf(s1 + 2); // no-warning in test_char_pointer_arithmetic()
766 printf(s2 + 2); // no-warning in test_char_pointer_arithmetic()
769 printf((s3 + 2) - 2); // expected-warning{{more '%' conversions than data arguments}} in test_char_pointer_arithmetic()
771 printf(2 + s2); // no-warning in test_char_pointer_arithmetic()
772 printf(6 + s2 - 2); // no-warning in test_char_pointer_arithmetic()
773 printf(2 + (b ? s1 : s2)); // no-warning in test_char_pointer_arithmetic()
776 printf(2 + (b ? s2 : s5)); // expected-warning{{more '%' conversions than data arguments}} in test_char_pointer_arithmetic()
778 printf(2 + (b ? s2 : s5), ""); // no-warning in test_char_pointer_arithmetic()
779 printf(2 + (b ? s1 : s2 - 2), ""); // no-warning in test_char_pointer_arithmetic()
782 printf(2 + (b ? s1 : s6 - 2)); // expected-warning{{more '%' conversions than data arguments}} in test_char_pointer_arithmetic()
784 printf(1 ? s2 + 2 : s2); // no-warning in test_char_pointer_arithmetic()
785 printf(0 ? s2 : s2 + 2); // no-warning in test_char_pointer_arithmetic()
786 printf(2 + s2 + 5 * 3 - 16, ""); // expected-warning{{data argument not used}} in test_char_pointer_arithmetic()
789 printf(s7 + 3, ""); // expected-warning{{more '%' conversions than data arguments}} in test_char_pointer_arithmetic()
795printf(1 > 0); // expected-warning{{format string is not a string literal}} expected-error{{incomp… in PR30481()
799printf("%s", op); // expected-warning{{format specifies type 'char *' but the argument has type 'v… in test_printf_opaque_ptr()
831 // Default argument promotions for *printf in N2562 in test_promotion()
841 printf("%hhd %hd %d %hhd %hd %d", i, i, i, sc, sc, sc); // no-warning in test_promotion()
842 printf("%hhd %hd %d %hhd %hd %d", uc, uc, uc, c, c, c); // no-warning in test_promotion()
845printf("%ld", i); // expected-warning{{format specifies type 'long' but the argument has type 'int… in test_promotion()
846printf("%lld", i); // expected-warning{{format specifies type 'long long' but the argument has typ… in test_promotion()
847printf("%ld", sc); // expected-warning{{format specifies type 'long' but the argument has type 'si… in test_promotion()
848printf("%lld", sc); // expected-warning{{format specifies type 'long long' but the argument has ty… in test_promotion()
849printf("%ld", uc); // expected-warning{{format specifies type 'long' but the argument has type 'un… in test_promotion()
850printf("%lld", uc); // expected-warning{{format specifies type 'long long' but the argument has ty… in test_promotion()
851printf("%llx", i); // expected-warning{{format specifies type 'unsigned long long' but the argumen… in test_promotion()
854printf("%hf", // expected-warning{{length modifier 'h' results in undefined behavior or no effect … in test_promotion()
858 printf("%hd", ss); // no-warning in test_promotion()
859printf("%hhd", ss); // expected-warning{{format specifies type 'char' but the argument has type 's… in test_promotion()
860 printf("%hu", us); // no-warning in test_promotion()
861printf("%hhu", ss); // expected-warning{{format specifies type 'unsigned char' but the argument ha… in test_promotion()
864printf("%f", i); // expected-warning{{format specifies type 'double' but the argument has type 'in… in test_promotion()
865printf("%f", sc); // expected-warning{{format specifies type 'double' but the argument has type 's… in test_promotion()
866printf("%f", uc); // expected-warning{{format specifies type 'double' but the argument has type 'u… in test_promotion()
867printf("%f", c); // expected-warning{{format specifies type 'double' but the argument has type 'ch… in test_promotion()
868printf("%f", ss); // expected-warning{{format specifies type 'double' but the argument has type 's… in test_promotion()
869printf("%f", us); // expected-warning{{format specifies type 'double' but the argument has type 'u… in test_promotion()
873 printf("%hhu", 'a'); // no-warning in test_promotion()
874 printf("%hhd", 'a'); // no-warning in test_promotion()
875printf("%hd", 'a'); // expected-warning{{format specifies type 'short' but the argument has type '… in test_promotion()
876printf("%hu", 'a'); // expected-warning{{format specifies type 'unsigned short' but the argument h… in test_promotion()
877 printf("%d", 'a'); // no-warning in test_promotion()
878 printf("%u", 'a'); // no-warning in test_promotion()
881printf("%s", i); // expected-warning{{format specifies type 'char *' but the argument has type 'in… in test_promotion()