summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/PrintfFormatString.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2011-12-09 10:51:29 +0000
committerHans Wennborg <hans@hanshq.net>2011-12-09 10:51:29 +0000
commit2027de3be9ed2b8c0d22b077590d347872644693 (patch)
treea01b5755ee8fb8860f96e61b7e932e10fb914803 /clang/lib/Analysis/PrintfFormatString.cpp
parent222c66db38ee42453decabc87c0d156c59fc22cd (diff)
downloadbcm5719-llvm-2027de3be9ed2b8c0d22b077590d347872644693.tar.gz
bcm5719-llvm-2027de3be9ed2b8c0d22b077590d347872644693.zip
fix format specifier fixit for printf("%ld", "foo");
It should reset the length modifier (unless it's a wchar_t string). llvm-svn: 146252
Diffstat (limited to 'clang/lib/Analysis/PrintfFormatString.cpp')
-rw-r--r--clang/lib/Analysis/PrintfFormatString.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Analysis/PrintfFormatString.cpp b/clang/lib/Analysis/PrintfFormatString.cpp
index e14c9522925..097cc62a6c0 100644
--- a/clang/lib/Analysis/PrintfFormatString.cpp
+++ b/clang/lib/Analysis/PrintfFormatString.cpp
@@ -366,6 +366,8 @@ bool PrintfSpecifier::fixType(QualType QT, const LangOptions &LangOpt) {
// Set the long length modifier for wide characters
if (QT->getPointeeType()->isWideCharType())
LM.setKind(LengthModifier::AsWideChar);
+ else
+ LM.setKind(LengthModifier::None);
return true;
}
OpenPOWER on IntegriCloud