What C compilers have non-zero null

ARIEL at RELAY.Prime.COM ARIEL at RELAY.Prime.COM
Fri Jul 13 06:17:00 AEST 1990


A small clarification re "certain Prime computers":

The Prime 50 Series does use a non-zero representation
for NULL in some languages, particularily PL/I.

The C NULL is all 0-bits. Sometimes (in IX mode) 32 of
them, other times (V mode, on older machines) 48 bits.

If i is an int, and p is a pointer, then (in IX mode):

i = (int)p;
p = (void *)i;

changes the bit pattern. (i.e after these two statements
*(int *)&i != *(int *)&p is true if p != NULL)

The change is invertable (p ends up with the same value)
IF p is actually a valid pointer (including NULL of course)

Robert Ullmann



More information about the Comp.lang.c mailing list