use of NULL

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Feb 23 08:14:21 AEST 1989


In article <973 at optilink.UUCP> cramer at optilink.UUCP (Clayton Cramer) writes:
>Never pass bare 0 as a pointer argument -- but use the stdio.h
>definition of NULL, and the segmented architecture will NOT screw
>you.

Wrong.  Use of uncast NULL as an argument to a function is never correct
usage; although you can get away with it sometimes, it only "works" by
accident and may quit working suddenly if the implementation changes.
It is definitely not portable.  Always cast 0 or NULL to the correct
pointer type when used as a function argument.



More information about the Comp.lang.c mailing list