Abandon NULL for (0)

Henry Spencer henry at utzoo.uucp
Sat Oct 7 02:40:12 AEST 1989


In article <252B5E41.1244 at marob.masa.com> daveh at marob.masa.com (Dave Hammond) writes:
>#define NIL(t)	(t *)0
>
>This produces fairly readable and maintainable code, as in:
>
>if (fp == NIL(FILE))

Is there some reason why this is superior to `if (fp == (FILE *)NULL)' or
just `if (fp == NULL)'?  You don't need that cast anywhere except in an
argument to a function (in the absence of ANSI C prototypes).
-- 
Nature is blind; Man is merely |     Henry Spencer at U of Toronto Zoology
shortsighted (and improving).  | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list