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
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user