Lines Matching full:scanf
12 int scanf(const char * restrict, ...) ;
21 scanf(s, i); // expected-warning{{ormat string is not a string literal}}
22 scanf("%0d", i); // expected-warning{{zero field width in scanf format string is unused}}
23 scanf("%00d", i); // expected-warning{{zero field width in scanf format string is unused}}
24 scanf("%d%[asdfasdfd", i, s); // expected-warning{{no closing ']' for '%[' in scanf format string}}
27 scanf ("%" "hu" "\n", &s_x); // no-warning
28 scanf("%y", i); // expected-warning{{invalid conversion specifier 'y'}}
29 scanf("%%"); // no-warning
30 scanf("%%%1$d", i); // no-warning
31 scanf("%1$d%%", i); // no-warning
32 scanf("%d", i, i); // expected-warning{{data argument not used by format string}}
33 scanf("%*d", i); // // expected-warning{{data argument not used by format string}}
34 scanf("%*d", i); // // expected-warning{{data argument not used by format string}}
35 scanf("%*d%1$d", i); // no-warning
39 scanf("%hhs", "foo"); // expected-warning{{length modifier 'hh' results in undefined behavior or no effect with 's' conversion specifier}}
40 scanf("%1$zp", &p); // expected-warning{{length modifier 'z' results in undefined behavior or no effect with 'p' conversion specifier}}
41 scanf("%ls", ws); // no-warning
42 scanf("%#.2Lf", ld); // expected-warning{{invalid conversion specifier '#'}}
45 // Test that the scanf call site is where the warning is attached. If the
51 scanf(kFormat1, i); // expected-warning{{zero field width in scanf format string is unused}}
52 scanf("%00d", i); // expected-warning{{zero field width in scanf format string is unused}}
54 scanf(kFormat2, str); // expected-warning{{no closing ']' for '%[' in scanf format string}}
55 scanf("%[", str); // expected-warning{{no closing ']' for '%[' in scanf format string}}
57 scanf(kFormat3, &i); // expected-warning {{format specifies type 'unsigned short *' but the argument}}
59 scanf(kFormat4, &i); // expected-warning {{length modifier 'l' results in undefined behavior or no effect with 'p' conversion specifier}}
73 vscanf("%[abc", ap); // expected-warning{{no closing ']' for '%[' in scanf format string}}
74 vfscanf(f, "%[abc", ap); // expected-warning{{no closing ']' for '%[' in scanf format string}}
75 vsscanf(buf, "%[abc", ap); // expected-warning{{no closing ']' for '%[' in scanf format string}}
79 scanf("%[abc]", ip); // expected-warning{{format specifies type 'char *' but the argument has type 'int *'}}
80 scanf("%h[abc]", sp); // expected-warning{{length modifier 'h' results in undefined behavior or no effect with '[' conversion specifier}}
81 scanf("%l[xyx]", ls); // no-warning
82 scanf("%ll[xyx]", ls); // expected-warning {{length modifier 'll' results in undefined behavior or no effect with '[' conversion specifier}}
89 scanf("%as", sp); // expected-warning{{format specifies type 'float *' but the argument has type 'char **'}}
90 scanf("%aS", lsp); // expected-warning{{format specifies type 'float *' but the argument has type 'wchar_t **'}}
91 scanf("%a[bcd]", sp); // expected-warning{{format specifies type 'float *' but the argument has type 'char **'}}
95 scanf("%ms", sp); // No warning.
96 scanf("%mS", lsp); // No warning.
97 scanf("%mc", sp); // No warning.
98 scanf("%mC", lsp); // No warning.
99 scanf("%m[abc]", sp); // No warning.
100 scanf("%md", sp); // expected-warning{{length modifier 'm' results in undefined behavior or no effect with 'd' conversion specifier}}
103 scanf("%ms", fp); // expected-warning{{format specifies type 'char **' but the argument has type 'float *'}}
104 scanf("%mS", fp); // expected-warning{{format specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}}
105 scanf("%mc", fp); // expected-warning{{format specifies type 'char **' but the argument has type 'float *'}}
106 scanf("%mC", fp); // expected-warning{{format specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}}
107 scanf("%m[abc]", fp); // expected-warning{{format specifies type 'char **' but the argument has type 'float *'}}
111 scanf("%Ld", y); // no-warning
112 scanf("%Lu", y); // no-warning
113 scanf("%Lx", y); // no-warning
114 scanf("%Ld", x); // no-warning
115 scanf("%Lu", x); // no-warning
116 scanf("%Lx", x); // no-warning
117 scanf("%Ls", "hello"); // expected-warning {{length modifier 'L' results in undefined behavior or no effect with 's' conversion specifier}}
121 scanf("%qd", x); // expected-warning{{format specifies type 'long long *' but the argument has type 'int *'}}
122 scanf("%qd", llx); // no-warning