diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-01-24 21:29:54 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-01-24 21:29:54 +0000 |
commit | 9d24c2cbd9cf1b7c165ccb13221f2efb2f4b49b0 (patch) | |
tree | ae2f66b9892e30f437bce30dc9bc7266319efa8b /test/Sema/format-strings-scanf.c | |
parent | 32d4abf2d1396b4434917320872a970415c08e6e (diff) |
Teach scanf/printf checking about '%Ld' and friends (a GNU extension). Fixes PR 9466.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings-scanf.c')
-rw-r--r-- | test/Sema/format-strings-scanf.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Sema/format-strings-scanf.c b/test/Sema/format-strings-scanf.c index 6962a97611..d89dbc494b 100644 --- a/test/Sema/format-strings-scanf.c +++ b/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}} +} + |