J
James Kanze
James said:I prefer not to.James Kanze wrote:
[..] (To tell the truth, I
can't imagine a compiler vendor being stupid enough not to make
long 64 bits if the hardware supported it.)
Just imagine Microsoft.
Seriously, the Microsoft compilers I've used all had size_t as a
32 bit quantity. Presumably, if and when Microsoft extends
their compiler to support 64 bit systems, both size_t and long
will become 64 bit quantities. Making long smaller than a
pointer will break a lot of code. (Admittedly already broken,
but that's not the point---it works with todays compilers.)
What relationship there is between size_t and "Making long
smaller than a pointer"? How can you compare a pointer with
long? You can only compare long with ptrdiff_t.
None. This is a parenthetical remark (in the context of this
thread.) In practice, there's a lot of code out there that
assumes that you can cast a pointer to a long (although the
standard doesn't guarantee it). If the size of a long is
smaller than the size of a pointer, this code is broken. Thus,
on a 64 bit machine, with 64 bit linear addressing, it would
take real perversion on the part of a vendor to make long
anything other than 64 bits.