• Home
  • Raw
  • Download

Lines Matching refs:printf

7 int printf(const char *restrict, ...); // expected-note{{passing argument to parameter here}}
25 printf(s); // expected-warning {{format string is not a string literal}} in check_string_literal()
42 printf("abc" in check_string_literal()
44 printf("abc\ in check_string_literal()
51 printf("%*d", (unsigned) 1, 1); // no-warning in check_string_literal()
55 printf(i == 1 ? "yes" : "no"); // no-warning in check_conditional_literal()
56 printf(i == 0 ? (i == 1 ? "yes" : "no") : "dont know"); // no-warning in check_conditional_literal()
57printf(i == 0 ? (i == 1 ? s : "no") : "dont know"); // expected-warning{{format string is not a st… in check_conditional_literal()
58 printf("yes" ?: "no %d", 1); // expected-warning{{data argument not used by format string}} in check_conditional_literal()
66 printf("%n",&x); // expected-warning {{'%n' in format string discouraged}} in check_writeback_specifier()
72 printf("%s%lb%d","unix",10,20); // expected-warning {{invalid conversion specifier 'b'}} in check_invalid_specifier()
80 printf("\0this is bogus%d",1); // expected-warning {{string contains '\0'}} in check_null_char_string()
82 printf("%\0d",1); // expected-warning {{string contains '\0'}} in check_null_char_string()
98printf(L"foo %d",2); // expected-warning {{incompatible pointer types}}, expected-warning {{should… in check_wide_string()
103printf("%*d"); // expected-warning {{'*' specified field width is missing a matching 'int' argumen… in check_asterisk_precision_width()
104printf("%.*d"); // expected-warning {{'.*' specified field precision is missing a matching 'int' a… in check_asterisk_precision_width()
105 printf("%*d",12,x); // no-warning in check_asterisk_precision_width()
106printf("%*d","foo",x); // expected-warning {{field width should have type 'int', but argument has … in check_asterisk_precision_width()
107printf("%.*d","foo",x); // expected-warning {{field precision should have type 'int', but argument… in check_asterisk_precision_width()
110 void __attribute__((format(printf,1,3))) myprintf(const char*, int blah, ...);
123 printf(s1); // no-warning in test_constant_bindings()
124 printf(s2); // no-warning in test_constant_bindings()
125 printf(s3); // expected-warning{{not a string literal}} in test_constant_bindings()
126 printf(s4); // expected-warning{{not a string literal}} in test_constant_bindings()
127 printf(s5); // expected-warning{{not a string literal}} in test_constant_bindings()
137 printf(P); // expected-warning {{format string is not a string literal (potentially insecure)}} in test9()
138 printf(P, 42); in test9()
139 printf("%n", &x); // expected-warning {{use of '%n' in format string discouraged }} in test9()
148 printf("%s"); // expected-warning{{more '%' conversions than data arguments}} in test10()
149 printf("%@", 12); // expected-warning{{invalid conversion specifier '@'}} in test10()
150 printf("\0"); // expected-warning{{format string contains '\0' within the string body}} in test10()
151 printf("xs\0"); // expected-warning{{format string contains '\0' within the string body}} in test10()
152printf("%*d\n"); // expected-warning{{'*' specified field width is missing a matching 'int' argume… in test10()
153printf("%*.*d\n", x); // expected-warning{{'.*' specified field precision is missing a matching 'i… in test10()
154printf("%*d\n", f, x); // expected-warning{{field width should have type 'int', but argument has t… in test10()
155printf("%*.*d\n", x, f, x); // expected-warning{{field precision should have type 'int', but argum… in test10()
156 printf("%**\n"); // expected-warning{{invalid conversion specifier '*'}} in test10()
157printf("%n", &i); // expected-warning{{use of '%n' in format string discouraged (potentially insec… in test10()
158 printf("%d%d\n", x); // expected-warning{{more '%' conversions than data arguments}} in test10()
159 printf("%d\n", x, x); // expected-warning{{data argument not used by format string}} in test10()
160printf("%W%d%Z\n", x, x, x); // expected-warning{{invalid conversion specifier 'W'}} expected-warn… in test10()
161 printf("%"); // expected-warning{{incomplete format specifier}} in test10()
162 printf("%.d", x); // no-warning in test10()
163 printf("%.", x); // expected-warning{{incomplete format specifier}} in test10()
164printf("%f", 4); // expected-warning{{conversion specifies type 'double' but the argument has type… in test10()
165 printf("%qd", lli); in test10()
166 printf("hhX %hhX", (unsigned char)10); // no-warning in test10()
167 printf("llX %llX", (long long) 10); // no-warning in test10()
169 printf("%d", (unsigned char) 10); // no-warning in test10()
170printf("%d", (long long) 10); // expected-warning{{conversion specifies type 'int' but the argumen… in test10()
171 printf("%Lf\n", (long double) 1.0); // no-warning in test10()
172printf("%f\n", (long double) 1.0); // expected-warning{{conversion specifies type 'double' but the… in test10()
174 printf("%.0Lf", (long double) 1.0); // no-warning in test10()
175printf("%c\n", "x"); // expected-warning{{conversion specifies type 'int' but the argument has typ… in test10()
176printf("%c\n", 1.23); // expected-warning{{conversion specifies type 'int' but the argument has ty… in test10()
177 printf("Format %d, is %! %f", 1, 2, 4.4); // expected-warning{{invalid conversion specifier '!'}} in test10()
183printf("%hhu", (short) 10); // expected-warning{{conversion specifies type 'unsigned char' but the… in should_understand_small_integers()
184printf("%hu\n", (unsigned char) 1); // expected-warning{{conversion specifies type 'unsigned short… in should_understand_small_integers()
185printf("%hu\n", (uint8_t)1); // expected-warning{{conversion specifies type 'unsigned short' but t… in should_understand_small_integers()
189 printf("%p", p); // no-warning in test11()
190printf("%p", 123); // expected-warning{{conversion specifies type 'void *' but the argument has ty… in test11()
191printf("%.4p", p); // expected-warning{{precision used with 'p' conversion specifier, resulting in… in test11()
192printf("%+p", p); // expected-warning{{flag '+' results in undefined behavior with 'p' conversion … in test11()
193printf("% p", p); // expected-warning{{flag ' ' results in undefined behavior with 'p' conversion … in test11()
194printf("%0p", p); // expected-warning{{flag '0' results in undefined behavior with 'p' conversion … in test11()
195 printf("%s", s); // no-warning in test11()
196printf("%+s", p); // expected-warning{{flag '+' results in undefined behavior with 's' conversion … in test11()
197printf("% s", p); // expected-warning{{flag ' ' results in undefined behavior with 's' conversion … in test11()
198printf("%0s", p); // expected-warning{{flag '0' results in undefined behavior with 's' conversion … in test11()
203 printf ("%.4s\n", buf); // no-warning in test12()
204printf ("%.4s\n", &buf); // expected-warning{{conversion specifies type 'char *' but the argument … in test12()
221 void f0(int_t x) { printf("%d\n", x); } in f0()
228 printf("%S", s); // no-warning in test_unicode_conversions()
229printf("%s", s); // expected-warning{{conversion specifies type 'char *' but the argument has type… in test_unicode_conversions()
230 printf("%C", s[0]); // no-warning in test_unicode_conversions()
231 printf("%c", s[0]); in test_unicode_conversions()
236 printf("%S", "hello"); // expected-warning{{but the argument has type 'char *'}} in test_unicode_conversions()
243printf("%0$", (int)2); // expected-warning{{position arguments in format strings start counting at… in test_positional_arguments()
244printf("%1$*0$d", (int) 2); // expected-warning{{position arguments in format strings start counti… in test_positional_arguments()
245 printf("%1$d", (int) 2); // no-warning in test_positional_arguments()
246 printf("%1$d", (int) 2, 2); // expected-warning{{data argument not used by format string}} in test_positional_arguments()
247printf("%1$d%1$f", (int) 2); // expected-warning{{conversion specifies type 'double' but the argum… in test_positional_arguments()
248 printf("%1$2.2d", (int) 2); // no-warning in test_positional_arguments()
249 printf("%2$*1$.2d", (int) 2, (int) 3); // no-warning in test_positional_arguments()
250printf("%2$*8$d", (int) 2, (int) 3); // expected-warning{{specified field width is missing a match… in test_positional_arguments()
251 printf("%%%1$d", (int) 2); // no-warning in test_positional_arguments()
252 printf("%1$d%%", (int) 2); // no-warning in test_positional_arguments()
256 void myprintf_PR_6697(const char *format, int x, ...) __attribute__((__format__(printf,1, 3)));
274printf("%hhs", "foo"); // expected-warning{{length modifier 'hh' results in undefined behavior or … in bug7377_bad_length_mod_usage()
275printf("%1$zp", (void *)0); // expected-warning{{length modifier 'z' results in undefined behavior… in bug7377_bad_length_mod_usage()
276 printf("%ls", L"foo"); // no-warning in bug7377_bad_length_mod_usage()
277 printf("%#.2Lf", (long double)1.234); // no-warning in bug7377_bad_length_mod_usage()
280printf("%#p", (void *) 0); // expected-warning{{flag '#' results in undefined behavior with 'p' co… in bug7377_bad_length_mod_usage()
281 printf("%0d", -1); // no-warning in bug7377_bad_length_mod_usage()
282printf("%#n", (void *) 0); // expected-warning{{flag '#' results in undefined behavior with 'n' co… in bug7377_bad_length_mod_usage()
283printf("%-n", (void *) 0); // expected-warning{{flag '-' results in undefined behavior with 'n' co… in bug7377_bad_length_mod_usage()
284 printf("%-p", (void *) 0); // no-warning in bug7377_bad_length_mod_usage()
287printf("%.2c", 'a'); // expected-warning{{precision used with 'c' conversion specifier, resulting … in bug7377_bad_length_mod_usage()
288printf("%1n", (void *) 0); // expected-warning{{field width used with 'n' conversion specifier, re… in bug7377_bad_length_mod_usage()
289printf("%.9n", (void *) 0); // expected-warning{{precision used with 'n' conversion specifier, res… in bug7377_bad_length_mod_usage()
292 printf("% +f", 1.23); // expected-warning{{flag ' ' is ignored when flag '+' is present}} in bug7377_bad_length_mod_usage()
293 printf("%+ f", 1.23); // expected-warning{{flag ' ' is ignored when flag '+' is present}} in bug7377_bad_length_mod_usage()
294 printf("%0-f", 1.23); // expected-warning{{flag '0' is ignored when flag '-' is present}} in bug7377_bad_length_mod_usage()
295 printf("%-0f", 1.23); // expected-warning{{flag '0' is ignored when flag '-' is present}} in bug7377_bad_length_mod_usage()
296 printf("%-+f", 1.23); // no-warning in bug7377_bad_length_mod_usage()
306 printf("%lc", c); // no-warning in pr7981()
307 printf("%lc", 1.0); // expected-warning{{the argument has type 'double'}} in pr7981()
308 printf("%lc", (char) 1); // no-warning in pr7981()
309 printf("%lc", &c); // expected-warning{{the argument has type 'wint_t *' (aka 'int *')}} in pr7981()
310 printf("%lc", c2); // no-warning in pr7981()
317 printf(0); // no-warning in rdar8269537()
331 printf("%#x\n", 10); in pr8641()
332 printf("%#X\n", 10); in pr8641()
338 printf("%'d\n", 123456789); // no-warning in posix_extensions()
339 printf("%'i\n", 123456789); // no-warning in posix_extensions()
340 printf("%'f\n", (float) 1.0); // no-warning in posix_extensions()
341printf("%'p\n", (void*) 0); // expected-warning{{results in undefined behavior with 'p' conversion… in posix_extensions()
351printf("%s", 1); // expected-warning{{conversion specifies type 'char *' but the argument has type… in pr8486()
357 printf(__PRETTY_FUNCTION__); // no-warning in pr9314()
358 printf(__func__); // no-warning in pr9314()
361 int printf(const char * restrict, ...) __attribute__((__format__ (__printf__, 1, 2)));
364printf("%s", 2); // expected-warning{{conversion specifies type 'char *' but the argument has type… in rdar9612060()
368 printf("%c", y); // no-warning in check_char()
369 printf("%hhu", x); // no-warning in check_char()
370 printf("%hhi", y); // no-warning in check_char()
371 printf("%hhi", x); // no-warning in check_char()
372 printf("%c", x); // no-warning in check_char()
373 printf("%hhu", y); // no-warning in check_char()