use of NULL

Clayton Cramer cramer at optilink.UUCP
Fri Feb 17 10:44:26 AEST 1989


In article <9582 at smoke.BRL.MIL., gwyn at smoke.BRL.MIL (Doug Gwyn ) writes:
. In article <1340 at uwbull.uwbln.UUCP. ckl at uwbln.UUCP (Christoph Kuenkel) writes:
. .Why at all should I ever use NULL anywhere?
. 
. Some think that use of a mnemonic makes the code more intelligible.
. If C were being designed now, I would recommend that "nil" be made
. a language keyword.
. 
. .its much more obvious to write 0,  when I mean zero,  ((char *) 0) when
. .I mean a zero character pointer, etc. etc.
. 
. Using 0 instead of NULL is perfectly acceptable.

No it isn't.  Segmented architecture machines will have problems with
that in large model.  Microsoft defines NULL as 0L, not 0, in large
model.  Pushing an int 0 instead of a long 0 will screw you royally
on the PC.
-- 
Clayton E. Cramer
{pyramid,pixar,tekbspa}!optilink!cramer
Disclaimer?  You must be kidding!  No company would hold opinions like mine!



More information about the Comp.lang.c mailing list