This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Allow 64bit warnings on 32bit targets
On Fri, Dec 19, 2003 at 07:54:11PM +0000, Joseph S. Myers wrote:
> > Valid point. I guess it would be better if it checked for the target
> > type not being long (I think that would cover it). I will submit a new
> > patch with that change.
>
> That doesn't work, as e.g. glibc makes intptr_t int on 32-bit systems, but
> casting to intptr_t (with an include of <stdint.h>) is always safe (if
> that type exists at all) since the typedef becomes a long on 64-bit
> systems. To be useful you need to distinguish use of such typedefs (safe)
> from hardcoded int (definitely unsafe), while hardcoded long is probably
> safe for most systems but maybe not in general.
The right fix would be to just fix glibc to use long. I can do that
when the patch is accepted.
-Andi