From 1eb342920b33cda278a913435daad6e1dece6396 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Thu, 17 Jan 2013 22:34:10 +0000 Subject: Format strings: don't ever convert %+d to %lu. Presumably, if the printf format has the sign explicitly requested, the user wants to treat the data as signed. This is a fix-up for r172739, and also includes several test changes that didn't make it into that commit. llvm-svn: 172762 --- clang/lib/Analysis/PrintfFormatString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Analysis') diff --git a/clang/lib/Analysis/PrintfFormatString.cpp b/clang/lib/Analysis/PrintfFormatString.cpp index 5d37de362a4..8f151b9358e 100644 --- a/clang/lib/Analysis/PrintfFormatString.cpp +++ b/clang/lib/Analysis/PrintfFormatString.cpp @@ -511,7 +511,7 @@ bool PrintfSpecifier::fixType(QualType QT, const LangOptions &LangOpt, case ConversionSpecifier::dArg: case ConversionSpecifier::DArg: case ConversionSpecifier::iArg: - if (QT->isUnsignedIntegerType()) + if (QT->isUnsignedIntegerType() && !HasPlusPrefix) CS.setKind(clang::analyze_format_string::ConversionSpecifier::uArg); break; default: -- cgit v1.2.3