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

Ted Kremenek kremenek at apple.com
Tue Jan 8 11:13:04 PST 2013


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.



More information about the cfe-dev mailing list