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 | 6aaa87e0d27b42d1d7a95c8591b57fc5b3725fb0 (patch) | |
tree | 1fc2174aeb661488ecbeedb2cfba68f86fc39e66 /clang/lib/Analysis/PrintfFormatString.cpp | |
parent | 507aca835ea2bf1735e2f89a0904d6f6d0dfdd40 (diff) | |
download | llvm-6aaa87e0d27b42d1d7a95c8591b57fc5b3725fb0.zip llvm-6aaa87e0d27b42d1d7a95c8591b57fc5b3725fb0.tar.gz llvm-6aaa87e0d27b42d1d7a95c8591b57fc5b3725fb0.tar.bz2 |
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.
llvm-svn: 169397
Diffstat (limited to 'clang/lib/Analysis/PrintfFormatString.cpp')
-rw-r--r-- | clang/lib/Analysis/PrintfFormatString.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Analysis/PrintfFormatString.cpp b/clang/lib/Analysis/PrintfFormatString.cpp index 611815c..0820791 100644 --- a/clang/lib/Analysis/PrintfFormatString.cpp +++ b/clang/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); |