Precedent for use of = (Actually NULL & 0)

purtill at petrus.UUCP purtill at petrus.UUCP
Thu Jul 17 01:39:18 AEST 1986


>I've been looking at 4.3 code, particularly for the Sun.  There are plenty of
>places where pointers are used indifferently as pointers to structures and
>as pointers to arrays.  There is code which relies on ints and pointers being
>the same size.  There is code which relies on successive declarations being
>stored contiguously and in order.  
All of these are of course nonportable, but....
>Code which relies on NULL equalling zero
>is omnipresent.  
This is perfectly legal.  NULL == 0.  A null pointer may NOT be 0, but
that's the compiler's problem, not yours.  When the CONSTANT 0 is converted
to a pointer, it has to be changed into a null pointer.  This was gone thru
in great detail a few months ago.

            mark purtill            (201) 829-5127
^.-.^ Arpa: purtill at bellcore.com    435 south st 2H-307
((")) Uucp: ihnp4!bellcore!purtill  morristown nj 07960



More information about the Comp.lang.c mailing list