[cfe-dev] -Wint-to-pointer-cast on by default?

David Blaikie dblaikie at gmail.com
Tue Jan 8 12:28:50 PST 2013


On Tue, Jan 8, 2013 at 11:13 AM, Ted Kremenek <kremenek at apple.com> wrote:
> I noticed that -Wint-to-pointer-cast is covered by -Wall and -Wmost, but it also appears to be enabled by default.  Is this intended?
>
> Looks like it was added in October:
>
>> Author: David Blaikie <dblaikie at gmail.com>
>> Date:   Tue Oct 16 18:53:14 2012 +0000
>>
>>     Implement GCC's -Wint-to-pointer-cast.
>>
>>     This implementation doesn't warn on anything that GCC doesn't warn on with the
>>     exception of templates specializations (GCC doesn't warn, Clang does). The
>>     specific skipped cases (boolean, constant expressions, enums) are open for
>>     debate/adjustment if anyone wants to demonstrate that GCC is being overly
>>     conservative here. The only really obvious false positive I found was in the
>>     Clang regression suite's MPI test - apparently MPI uses specific flag values in
>>     pointer constants. (eg: #define FOO (void*)~0)
>
> I'm not objecting to it being on by default.  Just wanted to know if this was intended.

Nope, no reason I can see that it should be in any group. Removed from
-Wmost (I guess it was in -Wall just by consequence of it being in
-Wall) in r171893.

Thanks!

- David



More information about the cfe-dev mailing list