summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/format-strings-scanf.c
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-01-24 21:29:54 +0000
committerTed Kremenek <kremenek@apple.com>2012-01-24 21:29:54 +0000
commit6fa57279396745d875676e958185b9377cdf2349 (patch)
tree15ae4c34a71154f5d08ddc2dbb8faca052fcee80 /clang/test/Sema/format-strings-scanf.c
parent3c1c7952b1aff6442836ae35bf238a0dc95200de (diff)
downloadbcm5719-llvm-6fa57279396745d875676e958185b9377cdf2349.tar.gz
bcm5719-llvm-6fa57279396745d875676e958185b9377cdf2349.zip
Teach scanf/printf checking about '%Ld' and friends (a GNU extension). Fixes PR 9466.
llvm-svn: 148859
Diffstat (limited to 'clang/test/Sema/format-strings-scanf.c')
-rw-r--r--clang/test/Sema/format-strings-scanf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Sema/format-strings-scanf.c b/clang/test/Sema/format-strings-scanf.c
index 6962a976113..d89dbc494b7 100644
--- a/clang/test/Sema/format-strings-scanf.c
+++ b/clang/test/Sema/format-strings-scanf.c
@@ -103,3 +103,13 @@ void test_alloc_extension(char **sp, wchar_t **lsp, float *fp) {
scanf("%m[abc]", fp); // expected-warning{{format specifies type 'char **' but the argument has type 'float *'}}
}
+void test_longlong(long long *x, unsigned long long *y) {
+ scanf("%Ld", y); // no-warning
+ scanf("%Lu", y); // no-warning
+ scanf("%Lx", y); // no-warning
+ scanf("%Ld", x); // no-warning
+ scanf("%Lu", x); // no-warning
+ scanf("%Lx", x); // no-warning
+ scanf("%Ls", "hello"); // expected-warning {{length modifier 'L' results in undefined behavior or no effect with 's' conversion specifier}}
+}
+
OpenPOWER on IntegriCloud