/external/clang/test/Sema/ |
D | format-strings-scanf.c | 12 int scanf(const char * restrict, ...) ; 21 scanf(s, i); // expected-warning{{format string is not a string literal}} in test() 22 scanf("%0d", i); // expected-warning{{zero field width in scanf format string is unused}} in test() 23 scanf("%00d", i); // expected-warning{{zero field width in scanf format string is unused}} in test() 24 …scanf("%d%[asdfasdfd", i, s); // expected-warning{{no closing ']' for '%[' in scanf format string}} in test() 27 scanf ("%" "hu" "\n", &s_x); // no-warning in test() 28 scanf("%y", i); // expected-warning{{invalid conversion specifier 'y'}} in test() 29 scanf("%%"); // no-warning in test() 30 scanf("%%%1$d", i); // no-warning in test() 31 scanf("%1$d%%", i); // no-warning in test() [all …]
|
D | format-strings-fixit.c | 99 int scanf(char const *, ...); 123 scanf("%lf", str); in test2() 124 scanf("%lf", vstr); in test2() 125 scanf("%ls", str); in test2() 126 scanf("%ls", str); in test2() 129 scanf("%f", &shortVar); in test2() 130 scanf("%f", &uShortVar); in test2() 131 scanf("%p", &intVar); in test2() 132 scanf("%f", intAVar); in test2() 133 scanf("%f", intSAParm); in test2() [all …]
|
D | format-strings-ms.c | 5 int scanf(const char * restrict, ...) ; 44 scanf("%wc", &c); in w_test() 45 scanf("%wC", &c); in w_test() 46 scanf("%C", &c); in w_test() 47 scanf("%ws", s); in w_test() 48 scanf("%wS", s); in w_test() 49 scanf("%S", s); in w_test() 58 …scanf("%wc", &bad); // expected-warning{{format specifies type 'wchar_t *' (aka 'unsigned short *'… in w_test() 59 …scanf("%wC", &bad); // expected-warning{{format specifies type 'wchar_t *' (aka 'unsigned short *'… in w_test() 60 …scanf("%C", &bad); // expected-warning{{format specifies type 'wchar_t *' (aka 'unsigned short *')… in w_test() [all …]
|
D | format-strings-c90.c | 4 int scanf(const char * restrict, ...); 8 scanf("%as", sp); /* expected-warning{{'a' length modifier is not supported by ISO C}} */ in foo() 9 scanf("%a[abc]", sp); /* expected-warning{{'a' length modifier is not supported by ISO C}} */ in foo() 12 scanf("%a", fp); in foo() 13 scanf("%afoobar", fp); in foo() 20 scanf("%da", ip); in foo() 23 …scanf("%as", fp); /* expected-warning{{format specifies type 'char **' but the argument has type '… in foo() 25 …scanf("%aS", fp); /* expected-warning{{format specifies type 'wchar_t **' (aka 'int **') but the a… in foo() 28 …scanf("%a[abc]", fp); /* expected-warning{{format specifies type 'char **' but the argument has ty… in foo()
|
D | format-strings-int-typedefs.c | 4 int scanf(char const *, ...); 16 scanf("%jd", 0); // expected-warning {{format specifies type 'intmax_t *' (aka 'long long *')}} in test() 17 …scanf("%ju", 0); // expected-warning {{format specifies type 'uintmax_t *' (aka 'unsigned long lon… in test() 18 scanf("%zu", 0); // expected-warning {{format specifies type 'size_t *' (aka 'unsigned long *')}} in test() 19 scanf("%td", 0); // expected-warning {{format specifies type 'ptrdiff_t *' (aka 'int *')}} in test() 20 scanf("%lc", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} in test() 21 scanf("%ls", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} in test() 22 scanf("%S", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} in test() 23 scanf("%C", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} in test()
|
D | format-strings-gnu.c | 10 int scanf(const char * restrict, ...) ; 51 scanf("%Ld", y); // no-warning in scanf_longlong() 52 scanf("%Lu", y); // no-warning in scanf_longlong() 53 scanf("%Lx", y); // no-warning in scanf_longlong() 54 scanf("%Ld", x); // no-warning in scanf_longlong() 55 scanf("%Lu", x); // no-warning in scanf_longlong() 56 scanf("%Lx", x); // no-warning in scanf_longlong() 57 …scanf("%Ls", "hello"); // expected-warning {{length modifier 'L' results in undefined behavior or … in scanf_longlong()
|
D | format-strings-darwin.c | 11 int scanf(const char * restrict, ...) ; 57 …scanf("%hD", x); // expected-warning{{conversion specifier is not supported by ISO C}} expected-no… in testScanf() 58 …scanf("%lD", y); // expected-warning{{conversion specifier is not supported by ISO C}} expected-no… in testScanf() 59 …scanf("%hU", x); // expected-warning{{conversion specifier is not supported by ISO C}} expected-no… in testScanf() 60 …scanf("%lU", y); // expected-warning{{conversion specifier is not supported by ISO C}} expected-no… in testScanf() 61 …scanf("%hO", x); // expected-warning{{conversion specifier is not supported by ISO C}} expected-no… in testScanf() 62 …scanf("%lO", y); // expected-warning{{conversion specifier is not supported by ISO C}} expected-no… in testScanf()
|
/external/llvm-project/clang/test/Sema/ |
D | format-strings-scanf.c | 30 int scanf(const char * restrict, ...) ; 39 scanf(s, i); // expected-warning{{format string is not a string literal}} in test() 40 scanf("%0d", i); // expected-warning{{zero field width in scanf format string is unused}} in test() 41 scanf("%00d", i); // expected-warning{{zero field width in scanf format string is unused}} in test() 42 …scanf("%d%[asdfasdfd", i, s); // expected-warning{{no closing ']' for '%[' in scanf format string}} in test() 45 scanf ("%" "hu" "\n", &s_x); // no-warning in test() 46 scanf("%y", i); // expected-warning{{invalid conversion specifier 'y'}} in test() 47 scanf("%%"); // no-warning in test() 48 scanf("%%%1$d", i); // no-warning in test() 49 scanf("%1$d%%", i); // no-warning in test() [all …]
|
D | format-strings-fixit.c | 99 int scanf(char const *, ...); 123 scanf("%lf", str); in test2() 124 scanf("%lf", vstr); in test2() 125 scanf("%ls", str); in test2() 126 scanf("%ls", str); in test2() 129 scanf("%f", &shortVar); in test2() 130 scanf("%f", &uShortVar); in test2() 131 scanf("%p", &intVar); in test2() 132 scanf("%f", intAVar); in test2() 133 scanf("%f", intSAParm); in test2() [all …]
|
D | format-strings-ms.c | 5 int scanf(const char * restrict, ...) ; 44 scanf("%wc", &c); in w_test() 45 scanf("%wC", &c); in w_test() 46 scanf("%C", &c); in w_test() 47 scanf("%ws", s); in w_test() 48 scanf("%wS", s); in w_test() 49 scanf("%S", s); in w_test() 58 …scanf("%wc", &bad); // expected-warning{{format specifies type 'wchar_t *' (aka 'unsigned short *'… in w_test() 59 …scanf("%wC", &bad); // expected-warning{{format specifies type 'wchar_t *' (aka 'unsigned short *'… in w_test() 60 …scanf("%C", &bad); // expected-warning{{format specifies type 'wchar_t *' (aka 'unsigned short *')… in w_test() [all …]
|
D | format-strings-c90.c | 4 int scanf(const char * restrict, ...); 8 scanf("%as", sp); /* expected-warning{{'a' length modifier is not supported by ISO C}} */ in foo() 9 scanf("%a[abc]", sp); /* expected-warning{{'a' length modifier is not supported by ISO C}} */ in foo() 12 scanf("%a", fp); in foo() 13 scanf("%afoobar", fp); in foo() 20 scanf("%da", ip); in foo() 23 …scanf("%as", fp); /* expected-warning{{format specifies type 'char **' but the argument has type '… in foo() 25 …scanf("%aS", fp); /* expected-warning{{format specifies type 'wchar_t **' (aka 'int **') but the a… in foo() 28 …scanf("%a[abc]", fp); /* expected-warning{{format specifies type 'char **' but the argument has ty… in foo()
|
D | format-strings-int-typedefs.c | 4 int scanf(char const *, ...); 16 scanf("%jd", 0); // expected-warning {{format specifies type 'intmax_t *' (aka 'long long *')}} in test() 17 …scanf("%ju", 0); // expected-warning {{format specifies type 'uintmax_t *' (aka 'unsigned long lon… in test() 18 scanf("%zu", 0); // expected-warning {{format specifies type 'size_t *' (aka 'unsigned long *')}} in test() 19 scanf("%td", 0); // expected-warning {{format specifies type 'ptrdiff_t *' (aka 'int *')}} in test() 20 scanf("%lc", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} in test() 21 scanf("%ls", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} in test() 22 scanf("%S", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} in test() 23 scanf("%C", 0); // expected-warning {{format specifies type 'wchar_t *' (aka 'int *')}} in test()
|
D | format-strings-gnu.c | 10 int scanf(const char * restrict, ...) ; 51 scanf("%Ld", y); // no-warning in scanf_longlong() 52 scanf("%Lu", y); // no-warning in scanf_longlong() 53 scanf("%Lx", y); // no-warning in scanf_longlong() 54 scanf("%Ld", x); // no-warning in scanf_longlong() 55 scanf("%Lu", x); // no-warning in scanf_longlong() 56 scanf("%Lx", x); // no-warning in scanf_longlong() 57 …scanf("%Ls", "hello"); // expected-warning {{length modifier 'L' results in undefined behavior or … in scanf_longlong()
|
D | format-strings-darwin.c | 11 int scanf(const char * restrict, ...) ; 57 …scanf("%hD", x); // expected-warning{{conversion specifier is not supported by ISO C}} expected-no… in testScanf() 58 …scanf("%lD", y); // expected-warning{{conversion specifier is not supported by ISO C}} expected-no… in testScanf() 59 …scanf("%hU", x); // expected-warning{{conversion specifier is not supported by ISO C}} expected-no… in testScanf() 60 …scanf("%lU", y); // expected-warning{{conversion specifier is not supported by ISO C}} expected-no… in testScanf() 61 …scanf("%hO", x); // expected-warning{{conversion specifier is not supported by ISO C}} expected-no… in testScanf() 62 …scanf("%lO", y); // expected-warning{{conversion specifier is not supported by ISO C}} expected-no… in testScanf()
|
D | format-strings-enum.c | 14 EXTERN_C int scanf(const char *, ...); 47 …scanf("%c", fwd); // expected-warning{{format specifies type 'char *' but the argument has type 'e… in forward_enum() 48 scanf("%u", fwd); in forward_enum() 49 …scanf("%lu", fwd); // expected-warning{{format specifies type 'unsigned long *' but the argument h… in forward_enum() 50 …scanf("%p", fwd); // expected-warning{{format specifies type 'void **' but the argument has type '… in forward_enum()
|
/external/llvm-project/clang-tools-extra/test/clang-tidy/checkers/ |
D | cert-err34-c.c | 12 extern int scanf(const char * restrict format, ...); 40 scanf("%jd", &im); in f1() 57 scanf("%hhd", &c); in f1() 59 scanf("%hd", &s); in f1() 61 scanf("%zu", &st); in f1() 63 scanf("%td", &pt); in f1() 65 scanf("%o", ui); in f1() 67 scanf("%X", ui); in f1() 69 scanf("%x", ui); in f1() 91 scanf("%d%u%f", &i, &u, &f); in f3() [all …]
|
/external/clang/test/Analysis/ |
D | taint-generic.c | 3 int scanf(const char *restrict format, ...); 38 scanf("%d", &n); in bufferScanfDirect() 44 scanf("%d", &n); in bufferScanfArithmetic1() 51 scanf("%d", &n); in bufferScanfArithmetic2() 58 scanf("%d", &n); in bufferScanfAssignment() 68 …scanf("%d", t); // expected-warning {{format specifies type 'int *' but the argument has type 'int… in scanfArg() 113 scanf("%s", addr); in testTaintSystemCall() 125 scanf("%s", addr); in testTaintSystemCall2() 134 scanf("%s %d", addr, &numt); in testTaintSystemCall3() 141 scanf("%zd", &ts); in testTaintedBufferSize() [all …]
|
D | taint-tester.c | 17 scanf("%d", &n); in taintTracking() 31 scanf("%p", &ptr); in taintTracking() 43 scanf("%p", &xyPtr); in taintTracking() 51 scanf("%d", &xy.y); in taintTracking() 52 scanf("%d", &xy.x); in taintTracking() 57 scanf("%d %d", &xy.y, &xy.x); in taintTracking() 66 scanf("%d", &x); in BitwiseOp() 180 scanf("%s", s); in atoiTest()
|
/external/llvm-project/clang/test/Analysis/ |
D | taint-generic.c | 48 int scanf(const char *restrict format, ...); 91 scanf("%d", &n); in bufferScanfDirect() 97 scanf("%d", &n); in bufferScanfArithmetic1() 104 scanf("%d", &n); in bufferScanfArithmetic2() 111 scanf("%d", &n); in bufferScanfAssignment() 121 …scanf("%d", t); // expected-warning {{format specifies type 'int *' but the argument has type 'int… in scanfArg() 166 scanf("%s", addr); in testTaintSystemCall() 178 scanf("%s", addr); in testTaintSystemCall2() 187 scanf("%s %d", addr, &numt); in testTaintSystemCall3() 200 scanf("%zd", &ts); in testTaintedBufferSize() [all …]
|
D | taint-diagnostic-visitor.c | 5 int scanf(const char *restrict format, ...); 11 scanf("%s", buf); // expected-note {{Taint originated here}} in taintDiagnostic() 18 scanf("%d", &index); // expected-note {{Taint originated here}} in taintDiagnosticOutOfBound() 24 scanf("%d", &operand); // expected-note {{Value assigned to 'operand'}} in taintDiagnosticDivZero() 32 scanf("%d", &x); // expected-note {{Value assigned to 'x'}} in taintDiagnosticVLA()
|
D | taint-generic.cpp | 6 int scanf(const char*, ...); 16 void scanf(const char*, ...); 39 myNamespace::scanf("%d", &x); in testConfigurationNamespacePropagation1() 42 scanf("%d", &x); in testConfigurationNamespacePropagation1() 114 void scanf(const char*, int*); 121 foo.scanf("%d", &x); in testConfigurationMemberFunc()
|
D | taint-tester.c | 17 scanf("%d", &n); in taintTracking() 31 scanf("%p", &ptr); in taintTracking() 43 scanf("%p", &xyPtr); in taintTracking() 51 scanf("%d", &xy.y); in taintTracking() 52 scanf("%d", &xy.x); in taintTracking() 57 scanf("%d %d", &xy.y, &xy.x); in taintTracking() 66 scanf("%d", &x); in BitwiseOp() 180 scanf("%s", s); in atoiTest()
|
/external/clang/test/SemaCXX/ |
D | format-strings-0x.cpp | 4 extern int scanf(const char *restrict, ...); 9 …scanf("%as", sp); // expected-warning{{format specifies type 'float *' but the argument has type '… in f() 12 …scanf("%p", sp); // expected-warning{{format specifies type 'void **' but the argument has type '… in f() 15 scanf("%afoobar", fp); in f()
|
/external/llvm-project/clang/test/SemaCXX/ |
D | format-strings-0x.cpp | 4 extern int scanf(const char *restrict, ...); 9 …scanf("%as", sp); // expected-warning{{format specifies type 'float *' but the argument has type '… in f() 12 …scanf("%p", sp); // expected-warning{{format specifies type 'void **' but the argument has type '… in f() 15 scanf("%afoobar", fp); in f()
|
D | format-strings.cpp | 8 extern int scanf(const char *restrict, ...); 14 scanf("%as", sp); in f() 22 scanf("%afoobar", fp); in f() 34 int scanf(const char *, ...) __attribute__((format(scanf, 2, 3))); 44 foo.scanf("%d"); // expected-warning{{more '%' conversions than data arguments}} in h()
|