Bellybutton lint

utzoo!decvax!harpo!seismo!rlgvax!guy utzoo!decvax!harpo!seismo!rlgvax!guy
Sun Apr 24 00:15:18 AEST 1983


If it were defined that way, if you had a routine "foo":

foo(bar)
int *bar;
{
	if (bar == NULL)
		do one thing;
	else
		do another;
}

and you wanted to call "foo" with a null pointer, you would either have to
say

	foo((int *)0);

or say

	foo(NULL);

in which case "lint" would bitch that you were passing a "char *" to a
routine that expected an "int *", or say

	foo((int *)NULL);

in which case "lint" would bitch that you were trying to convert a "char *"
to an "int *" which is a Bozo No-No.  Trouble is there *is* no such thing
as a "null pointer" in C; there is a null character pointer, and a null
int pointer, and a null struct proc pointer, and a null int() pointer, and...

					Guy Harris
					RLG Corporation
					{seismo,mcnc,we13}!rlgvax!guy



More information about the Comp.lang.c mailing list