Unix Programming - Re: variadic null ptr

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > May 2007 > Re: variadic null ptr





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: variadic null ptr
Rainer Weikusat

2007-05-20, 7:19 am

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.



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com