On Tue, May 8, 2012 at 3:20 AM, Hans Wennborg <[email protected]> wrote:
> Hi all,
>
> For "%hhx", printf expects an unsigned char. This patch makes Clang
> accept a 'char' argument for that when using -funsigned-char.
LGTM, just a couple of minor suggestions:
case BuiltinType::Char_S:
case BuiltinType::SChar:
- return T == C.UnsignedCharTy;
+ return T == C.SignedCharTy || T == C.UnsignedCharTy;
case BuiltinType::Char_U:
- case BuiltinType::UChar:
- return T == C.SignedCharTy;
+ case BuiltinType::UChar:
+ return T == C.UnsignedCharTy || T == C.SignedCharTy;
Might as well just have all four BuiltinType::*Char* cases fall
through to the same return statement.
+// RUN: %clang_cc1 -fsyntax-only -verify -fno-signed-char %s
Maybe explicitly say -Wformat here?
>
> (Also removing some trailing whitespace and adding a few curly braces
> while we're here.)
If you want to do this cleanup, please do it in a separate commit.
-Matt
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits