05-20-07 12:19 PM
Erik Max Francis <max@alcyone.com> writes:
> Frank Cusack wrote:
>
> The Standard does not require that the sizes and layouts of the
> different data pointer types be equivalent.
> It does require that void * be able to hold every other pointer
> type, and that char * and void * have the same layout, but it makes
> no other requirements for any other types.
'The Standard' presumably refers to 'the ISO C-Standard' here. That
actually specifies somewhat more requirements, specifically, that all
pointers to structs 'have the same representation and alignment
requirements as each other' and 'all pointers to unions [same]'.
> In other words, say, (int *) 0 and (float *) 0 could have
> different values or even sizes.
"It depends". What SUS calls 'XSI' (X/Open System Interface) requires
that all pointers types can be used interchangeably for
stdarg-routines. A lot of other information source (like
http://www.unix.org/whitepapers/64bit.html) just assume this.
Since this group is generally targeted at actually programming
something, I'd like to ask which architectures with some UNIX(*) or
something like UNXI(*) running on them actually have (or had)
differerent pointer types for different pointed-to types.
[ Post a follow-up to this message ]
|