pointer <-> integer conversion warnings (bogus -Wall warnings)

Richard Henderson rth@redhat.com
Wed Mar 13 15:38:00 GMT 2002


On Wed, Mar 13, 2002 at 02:17:45PM -0800, Tom Lord wrote:
> 	and I think that's pretty nice.  One can safely assume that
> 	`size_t' is small enough not to overflow a pointer type and
> 	the double cast (aside from being easy to grep for) means
> 	"Yes, I really mean to truncate the integer if necessary
> 	before casting it to a pointer."
> 
> On second thought -- is there really any such guarantee?

No, that's what C99's intptr_t is for.  But as it happens, I've
never seen a system for which size_t was not the correct size.


r~



More information about the Gcc mailing list