diff options
| author | Ted Kremenek <kremenek@apple.com> | 2011-10-25 04:20:41 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2011-10-25 04:20:41 +0000 |
| commit | 74e82bd190017d59d5d78b07dedca5b06b4547da (patch) | |
| tree | 4d25c36bde5c85b773a6c78b4babfa72d59f07e1 /clang/test | |
| parent | baabbb779de90b60a44c67a115a56d2e63fdfa1b (diff) | |
| download | bcm5719-llvm-74e82bd190017d59d5d78b07dedca5b06b4547da.tar.gz bcm5719-llvm-74e82bd190017d59d5d78b07dedca5b06b4547da.zip | |
Tweak printf format string parsing to accept 'hh' conversion specifier to accept any char, not just signed char. Fixes <rdar://problem/10303638>.
llvm-svn: 142908
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Sema/format-strings.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c index 6b5f7e2c266..4f2ad99a572 100644 --- a/clang/test/Sema/format-strings.c +++ b/clang/test/Sema/format-strings.c @@ -212,6 +212,12 @@ void test12(char *b) { asprintf(&b, "%d", "asprintf"); // expected-warning{{conversion specifies type 'int' but the argument has type 'char *'}} } +void test13(short x) { + char bel = 007; + printf("bel: '0%hhd'\n", bel); // no-warning + printf("x: '0%hhd'\n", x); // expected-warning {{conversion specifies type 'char' but the argument has type 'short'}} +} + typedef struct __aslclient *aslclient; typedef struct __aslmsg *aslmsg; int asl_log(aslclient asl, aslmsg msg, int level, const char *format, ...) __attribute__((__format__ (__printf__, 4, 5))); |

