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

Hans Wennborg hans at chromium.org
Wed Feb 15 04:38:14 PST 2012


On Tue, Feb 14, 2012 at 21:49, Ted Kremenek <kremenek at apple.com> wrote:
> Looks great to me.

Thanks! Committed r150578.

>
> On Feb 14, 2012, at 7:43 AM, Hans Wennborg <hans at chromium.org> wrote:
>
>> 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"
>>
>> and
>>
>> printf("%x", (long)1); where we previously suggested "%ld", we now
>> suggest "%lx".
>>
>>
>> Please take a look.
>>
>> Thanks,
>> Hans
>> <preserve-conversion-specifiers.diff>
>



More information about the cfe-commits mailing list