[cfe-commits] [Patch] Format string warnings should refer to "%zu" etc by typedef type

David Blaikie dblaikie at gmail.com
Fri Dec 2 11:43:58 PST 2011


On Fri, Dec 2, 2011 at 11:26 AM, Hans Wennborg <hans at chromium.org> wrote:
> On Fri, Dec 2, 2011 at 5:24 PM, Matt Beaumont-Gay <matthewbg at google.com> wrote:
>> The | notation is a little surprising; I don't recall seeing it
>> anywhere else in Clang doxyments. Maybe just:
>>
>> /// Try to find and return a typedef type named Name whose actual type
>> is Underlying.
>
> Fixed. I had to think a while to realize that the | notation is used
> in Chromium sometimes; that's probably where I picked it up.
>
>> +++ b/test/Sema/format-strings-int-typedefs.c
>> @@ -0,0 +1,30 @@
>> +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
>>
>> Is the triple necessary here?
>
> Yes, the test has to know what underlying types to expect to see from
> the warnings.

This raises a question: Ideally this diagnostic should:

a) verify that the type used for the parameter to printf is actually
size_t, not unsigned int, for example
b) shouldn't mention the underlying type, only the typedef - since
that's what the format specifier is for.

yes?



More information about the cfe-commits mailing list