On 01/31/2012 08:42 PM, Mouse wrote:
The latter certainly is; there need not be _any_
integer type that's
the same size as a pointer, though on most machines there will be.
(Indeed, I _think_ there's no need that there be any integral type
large enough to hold a pointer....)
Correct. ISO/IEC 9899:1999 section 7.18.1.4
states that the integer
types intptr_t and uintptr_t can hold the value of a void* (and hence,
the value of any pointer type), but that these types are optional.
*If* the implementation has intptr_t and uintptr_t, then the same
properties should hold for intmax_t and uintmax_t, since these are
guaranteed to be at least as large as any other integer types. However,
if the implementation does not provide intptr_t or uintptr_t, then
intmax_t and uintmax_t aren't guaranteed to be able to hold pointer values.