This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]