aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/format-strings-scanf.c
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-01-20 22:11:52 +0000
committerTed Kremenek <kremenek@apple.com>2012-01-20 22:11:52 +0000
commitef1440b6eca118d46291166ce3302f9bba8e639b (patch)
tree3ef7f351444fbdf671ba4202fe5a6e1150c8b9fe /test/Sema/format-strings-scanf.c
parentc4f4d5d570f294d011e276dc18d6d840e847958a (diff)
The 'l' length modifier makes sense with the scanlist conversion specifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148586 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings-scanf.c')
-rw-r--r--test/Sema/format-strings-scanf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/Sema/format-strings-scanf.c b/test/Sema/format-strings-scanf.c
index e954958c52..6962a97611 100644
--- a/test/Sema/format-strings-scanf.c
+++ b/test/Sema/format-strings-scanf.c
@@ -71,9 +71,11 @@ void test_variants(int *i, const char *s, ...) {
vsscanf(buf, "%[abc", ap); // expected-warning{{no closing ']' for '%[' in scanf format string}}
}
-void test_scanlist(int *ip, char *sp) {
+void test_scanlist(int *ip, char *sp, wchar_t *ls) {
scanf("%[abc]", ip); // expected-warning{{format specifies type 'char *' but the argument has type 'int *'}}
scanf("%h[abc]", sp); // expected-warning{{length modifier 'h' results in undefined behavior or no effect with '[' conversion specifier}}
+ scanf("%l[xyx]", ls); // no-warning
+ scanf("%ll[xyx]", ls); // expected-warning {{length modifier 'll' results in undefined behavior or no effect with '[' conversion specifier}}
}
void test_alloc_extension(char **sp, wchar_t **lsp, float *fp) {
@@ -100,3 +102,4 @@ void test_alloc_extension(char **sp, wchar_t **lsp, float *fp) {
scanf("%mC", fp); // expected-warning{{format specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}}
scanf("%m[abc]", fp); // expected-warning{{format specifies type 'char **' but the argument has type 'float *'}}
}
+