[cfe-commits] [Patch] -Wformat fix-its: preserve original conversion specifiers (PR11975)

Hans Wennborg hans at chromium.org
Tue Feb 14 07:43:52 PST 2012

Hi all,

The attached patch makes PrintfSpecifier::fixType() and
ScanfSpecifier::fixType() only fix the conversion specification enough
that Clang wouldn't warn about it, as opposed to always changing it to
use the "canonical" conversion specifier. (PR11975)

This preserves the user's choice of conversion specifier in cases like:

printf("%a", (long double)1); where we previously suggested "%Lf", we
now suggest "%La"


printf("%x", (long)1); where we previously suggested "%ld", we now
suggest "%lx".

Please take a look.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: preserve-conversion-specifiers.diff
Type: text/x-patch
Size: 9395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120214/e15ed858/attachment.bin>

More information about the cfe-commits mailing list