ANSI C

Mark Brader msb at dciem.UUCP
Sat Aug 16 02:34:43 AEST 1986


Somebody writes:

> > In 3.2.2.3, "(void *)0" is called a null pointer constant, though 5.6.3.12
> > says the value of NULL is implementation-defined.  I take this to mean that
> > the internal representation of (void *)0 need not have all bits clear.

Guy Harris (guy at sun.uucp) replies:

> Yes.  I'm certain there are many machines out there that either have C
> implementations or should have them that have a representation for null
> pointers that is not a bucket of zero bits.

This is almost correct.  It IS true that (void *)0 need not have all bits
clear, but this is not what the reference in 5.6.3.12 is saying.  What it is
saying is that your implementation can #define NULL as either 0 or (void *)0.

Mark Brader, dciem!msb
#define	MSB(type)	(~(((unsigned type)-1)>>1))



More information about the Comp.lang.c mailing list