Let's define our own NULL II

Guy Harris guy at gorodish.Sun.COM
Wed Jun 29 03:37:25 AEST 1988


> A personal message to Guy Harris at Sun: I'd love to see your analysis of
> this -- I encountered this idea first at a company I will not name -- the
> one we both worked at as of the beginning of 1984 (though I was at their main
> facility).

Oh, you mean CCI?

If I'm writing code that includes some include file that defines NULL, I use
it; otherwise, I use 0.  I don't pull in e.g. <stdio.h> just to define NULL;
however, most of the code I write is either 1) in the kernel, in which case it
usually includes <sys/param.h> for other reasons and gets NULL predefined or 2)
not in the kernel, but uses standard I/O, in which case it includes <stdio.h>
and gets NULL predefined.

Had I an ANSI C environment I'd include <stddef.h> and get it defined that way.



More information about the Comp.lang.c mailing list