[cfe-commits] [Patch] -Wformat: better handling of qualifiers on pointer arguments

Jordan Rose jordan_rose at apple.com
Tue Jul 31 09:19:32 PDT 2012


LGTM!


On Jul 31, 2012, at 8:57 , Hans Wennborg <hans at chromium.org> wrote:

> Thanks, Jordan!
> 
> I've added some tests for the "const volatile" case. Yes, the types
> have already been canonicalized, but I've added a couple of tests for
> that anyway.
> 
> New patch attached. OK to commit?
> 
> - Hans
> 
> On Tue, Jul 31, 2012 at 4:23 PM, Jordan Rose <jordan_rose at apple.com> wrote:
>> Wow, nice idea. I would add "const volatile" to your test cases as well, even though I'm pretty sure "removeLocalVolatile" does the right thing.
>> 
>> (Also, typedefs? Or have we already canonicalized the type by this point?)
>> 
>> 
>> On Jul 31, 2012, at 3:25 AM, Hans Wennborg <hans at chromium.org> wrote:
>> 
>>> Hi all,
>>> 
>>> The attached patch makes Clang warn about passing in pointers to
>>> const-qualified types to scanf, such as passing in "const int*" for a
>>> "%d" format string.
>>> 
>>> It also ignores the volatile-qualifier, allowing to pass in a
>>> "volatile int*" pointer for a "%n" format string.
>>> 
>>> Please take a look!
>>> 
>>> Thanks,
>>> Hans
> <wformat_type_qualifiers2.patch>




More information about the cfe-commits mailing list