pointer sizes, was: Re: What does char **ch mean?

Andy Newman andy at research.canon.oz.au
Thu May 16 09:42:59 AEST 1991


In article <wolfram.674309645 at akela> Wolfram Roesler writes:
>I advised somebody something similar to that, telling him (like I learned
>from the FAQ) that weird machines have weird pointers, that (char*)0 and
>0L might have different binary representations and the like. His response
>to this was:
>	"I claim there are no machines like this"
>What do you gurus say about this? How about an example of a machine or OS
>where this is true?

Transputers have signed address spaces (start at 0x80000000 and ends
at 0x7FFFFFFF for 32 bit implementations), null pointers should have
the integer value 0x80000000 and not 0 (address 0 is smack, bang in the
middle of the address space).

I remember great concern by one compiler writer over what value should be
stored for null pointers. The person used 0 so as not to break all the source
that assumes that null pointers are 0. This threw away half the address
space of the machine (only 2Gb [on a 32 bit machine], what a bummer!).
-- 
Andy Newman (andy at research.canon.oz.au) Canon Info. Systems Research Australia



More information about the Comp.lang.c mailing list