offsets in structures.

Guy Harris guy at rlgvax.UUCP
Mon Oct 15 09:10:35 AEST 1984


> As has been discussed before, a 0 pointer in C is not
> appropriately mapped to a special nil pointer in tagged
> architectures.

Do you mean "(existing) implementations of C on tagged architectures do
not perform the appropriate mapping of a 0 pointer to a special nil
pointer", or "it is not appropriate to map a 0 pointer to a special
nil pointer in a tagged architecture?"  If the latter, I disagree; there
is no committment to the bit pattern of a 0 pointer in C, and no committment
to being able to dereference it.  As such, I see no reason not to map a 0
pointer onto bit pattern you want, as long as 1) it's distinct from *all*
bit patterns for legitimate pointers in C (i.e., your C implementation must
make sure no C function or variable has an address with that bit pattern) and
2) it fits in the same number of bits as any other pointer.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.lang.c mailing list