Abandon NULL for (0)

1 karl_auer_%7801.801 at fidogate.fido.oz
Wed Sep 27 22:00:00 AEST 1989


Original to: karl at haddock.ima.isc.com
In a message to All <22 Sep 89 15:42:26>, karl at haddock.ima.isc.com wrote:
 > In particular, if I were maintaining that code, I'd change the "(0)"'s 
 > back to "NULL"'s as fast as I found them.

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).

Besides, I prefer a meaningful word to a meaningless constant number
any day!

Regards, K.

--- Qtach2 v1.04 U4
 * Origin: Aust. QNX Users Group (+61-62-514589 9am-5pm AEST) (3:7801/801)



More information about the Comp.lang.c mailing list