[cfe-commits] [Patch] suggest %zu for size_t args to printf (PR11152)

Hans Wennborg hans at chromium.org
Tue Oct 18 01:35:34 PDT 2011


On Mon, Oct 17, 2011 at 8:18 PM, Peter Collingbourne <peter at pcc.me.uk> wrote:
> On Mon, Oct 17, 2011 at 10:59:50AM +0200, Hans Wennborg wrote:
>> Hi all,
>>
>> The attached patch is for PR11152.
>>
>> It makes PrintfSpecifier::fixType() choose "%zu" for size_t, etc.,
>> rather than looking at the underlying type and suggesting "%llu" or
>> other platform-specific length modifiers. This is for C99, C1X and
>> C++11.
>>
>> Please let me know if this is ok to land.
>
>> +      (LangOpt.C99 || LangOpt.C1X || LangOpt.CPlusPlus0x)) {
>
> C1X implies C99, so you don't need to test for it separately here.
> Other than that, LGTM.
>
> Thanks,
> --
> Peter
>

Removed the LangOpt.C1X check and landed as r142342.




More information about the cfe-commits mailing list