diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-12-05 18:44:37 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-12-05 18:44:37 +0000 |
commit | ff7be48165548c9c01492010609d166973607068 (patch) | |
tree | 22eb181aecc7f65af5ae6f6a339976ed22d86241 /lib/Analysis/PrintfFormatString.cpp | |
parent | dfbb3197de8407a4209f328e4de1ae73bac70b8b (diff) |
Format strings: the correct conversion for 'char' is %c, not %d or %hhd.
We tried to account for 'uint8_t' by saying that /typedefs/ of 'char'
should be corrected as %hhd rather than %c, but the condition was wrong.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PrintfFormatString.cpp')
-rw-r--r-- | lib/Analysis/PrintfFormatString.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp index 611815cd89..08207910b8 100644 --- a/lib/Analysis/PrintfFormatString.cpp +++ b/lib/Analysis/PrintfFormatString.cpp @@ -506,7 +506,7 @@ bool PrintfSpecifier::fixType(QualType QT, const LangOptions &LangOpt, // Set conversion specifier and disable any flags which do not apply to it. // Let typedefs to char fall through to int, as %c is silly for uint8_t. - if (isa<TypedefType>(QT) && QT->isAnyCharacterType()) { + if (!isa<TypedefType>(QT) && QT->isCharType()) { CS.setKind(ConversionSpecifier::cArg); LM.setKind(LengthModifier::None); Precision.setHowSpecified(OptionalAmount::NotSpecified); |