diff options
author | Jean-Daniel Dupas <devlists@shadowlab.org> | 2012-01-31 18:12:08 +0000 |
---|---|---|
committer | Jean-Daniel Dupas <devlists@shadowlab.org> | 2012-01-31 18:12:08 +0000 |
commit | 220947bd5a66b0f25f5e74d6029769dfb34f07b4 (patch) | |
tree | f64e592dc41ceada8fce03e9af46ab59fe6e30c7 /test/Sema/format-strings-scanf.c | |
parent | 7da1f4679332277614b6c583df66c3bfd94ded66 (diff) |
FormatCheckers should emit all diagnostics using EmitFormatDiagnostic().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings-scanf.c')
-rw-r--r-- | test/Sema/format-strings-scanf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Sema/format-strings-scanf.c b/test/Sema/format-strings-scanf.c index d89dbc494b..c97da3fd92 100644 --- a/test/Sema/format-strings-scanf.c +++ b/test/Sema/format-strings-scanf.c @@ -53,6 +53,10 @@ void pr9751() { const char kFormat2[] = "%["; // expected-note{{format string is defined here}}} scanf(kFormat2, str); // expected-warning{{no closing ']' for '%[' in scanf format string}} scanf("%[", str); // expected-warning{{no closing ']' for '%[' in scanf format string}} + const char kFormat3[] = "%hu"; // expected-note{{format string is defined here}}} + scanf(kFormat3, &i); // expected-warning {{format specifies type 'unsigned short *' but the argument}} + const char kFormat4[] = "%lp"; // expected-note{{format string is defined here}}} + scanf(kFormat4, &i); // expected-warning {{length modifier 'l' results in undefined behavior or no effect with 'p' conversion specifier}} } void test_variants(int *i, const char *s, ...) { |