aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/format-strings-scanf.c
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2012-08-07 08:59:46 +0000
committerHans Wennborg <hans@hanshq.net>2012-08-07 08:59:46 +0000
commit58e1e54476d610d6c33ef483f216ed8a1282d35c (patch)
tree53ddc9b5444c8e4da14bfcf799a740466ed66a3d /test/Sema/format-strings-scanf.c
parent5d435b6001fb853747426bfa47b0e0f49a736fe4 (diff)
Remove ScanfArgType and bake that logic into ArgType.
This is useful for example for %n in printf, which expects a pointer to int with the same logic for checking as %d would have in scanf. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161407 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings-scanf.c')
-rw-r--r--test/Sema/format-strings-scanf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Sema/format-strings-scanf.c b/test/Sema/format-strings-scanf.c
index 6f6cb10eb3..49c97149a7 100644
--- a/test/Sema/format-strings-scanf.c
+++ b/test/Sema/format-strings-scanf.c
@@ -33,6 +33,12 @@ void test(const char *s, int *i) {
scanf("%*d", i); // // expected-warning{{data argument not used by format string}}
scanf("%*d", i); // // expected-warning{{data argument not used by format string}}
scanf("%*d%1$d", i); // no-warning
+
+ scanf("%s", (char*)0); // no-warning
+ scanf("%s", (volatile char*)0); // no-warning
+ scanf("%s", (signed char*)0); // no-warning
+ scanf("%s", (unsigned char*)0); // no-warning
+ scanf("%hhu", (signed char*)0); // no-warning
}
void bad_length_modifiers(char *s, void *p, wchar_t *ws, long double *ld) {