diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-07-19 22:01:06 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-07-19 22:01:06 +0000 |
commit | baa400654bd6f8396f9a07188445ae7955b060a3 (patch) | |
tree | 03ee1509fbb2d3ceb336f9c4c37b01e401ce3ccb /test/Sema/format-strings.c | |
parent | abc563f554951259bbe0315055cad92ee14d87e4 (diff) |
Don't warn when a '%%' or '%*d' (scanf) is used in a format string with positional arguments, since
these don't actually consume an argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108757 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r-- | test/Sema/format-strings.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c index c6dee6801e..080e4dbeb5 100644 --- a/test/Sema/format-strings.c +++ b/test/Sema/format-strings.c @@ -239,6 +239,8 @@ void test_positional_arguments() { printf("%1$2.2d", (int) 2); // no-warning printf("%2$*1$.2d", (int) 2, (int) 3); // no-warning printf("%2$*8$d", (int) 2, (int) 3); // expected-warning{{specified field width is missing a matching 'int' argument}} + printf("%%%1$d", (int) 2); // no-warning + printf("%1$d%%", (int) 2); // no-warning } // PR 6697 - Handle format strings where the data argument is not adjacent to the format string |