diff options
author | Hans Wennborg <hans@hanshq.net> | 2012-05-08 17:21:31 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2012-05-08 17:21:31 +0000 |
commit | 101d4e0c8ffbcdaaa58cddf1c20f98aa1b4501c4 (patch) | |
tree | 151fa3df415b3ecb77378869993a7a078f4eaa53 /test/Sema/format-strings.c | |
parent | fd04a6a88255ce3a90e5f73aef69c08bb5a35677 (diff) |
Make -Wformat accept printf("%hhx", c); with -funsigned-char
For "%hhx", printf expects an unsigned char. This makes Clang
accept a 'char' argument for that also when using -funsigned-char.
This fixes PR12761.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156388 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r-- | test/Sema/format-strings.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c index 5d8e4cbb87..1f9acd4ef8 100644 --- a/test/Sema/format-strings.c +++ b/test/Sema/format-strings.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify -Wformat-nonliteral -isystem %S/Inputs %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wformat-nonliteral -isystem %S/Inputs -fno-signed-char %s #define __need_wint_t #include <stdarg.h> @@ -530,3 +531,8 @@ void test_other_formats() { void test_unused_system_args(int x) { PRINT1("%d\n", x); // no-warning{{extra argument is system header is OK}} } + +void pr12761(char c) { + // This should not warn even with -fno-signed-char. + printf("%hhx", c); +} |