Abandon NULL for (0)

King Su wen-king at cit-vax.Caltech.Edu
Fri Oct 6 16:09:34 AEST 1989


In article <15571 at nswitgould.cs.uts.oz> karl_auer_%7801.801 at fidogate.fido.oz (1) writes:
>Original to: karl at haddock.ima.isc.com
<There is another good reason not to use '(0)' - in some
>implementations of C, pointers can have different sizes, requiring
>that NULL be sometimes defined as (0), sometimes as (0L) - as with
<almost all 80n86 implementations! Having a #define called NULL allows
>the program cc (or equivalent) to pick the appropriate include files,
<or allows conditional #defines depending on memory model (the usual
>method).

Please be sure to add that this is not required if a program is
correctly written, and it is merely a fixe to get some incorrectly
written programs to compile.
-- 
/*------------------------------------------------------------------------*\
| Wen-King Su  wen-king at vlsi.caltech.edu  Caltech Corp of Cosmic Engineers |
\*------------------------------------------------------------------------*/



More information about the Comp.lang.c mailing list