This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: patches for Irix binutils 2.18 -- removal of some casts
On Thu, 23 Oct 2008, Jay wrote:
Is it essentially guaranteed that sizeof(size_t) == sizeof(void*)?
Close, but not quite.
If, for some reason, one could address more memory
than one could allocate to a single object,
then sizeof(size_t)< sizeof(void*) is a possibility.
I would expect that to be rare.
One could ensure compile failure if size_t wasn't big enough:
enum { __fred__ = 1/(sizeof(size_t)>=sizeof(void*) };
But theoretically not, right?
I mean, you know, I wonder, in the absence of widespread C99 support, what to store pointers in if I really want an integer, and later back to a pointer, with no loss. Long is not it, it is wrong on Win64.
unsigned long doesn't work either?
--
Michael hennebry@web.cs.ndsu.NoDak.edu
"Pessimist: The glass is half empty.
Optimist: The glass is half full.
Engineer: The glass is twice as big as it needs to be."