NULL is not '\0'

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Jan 27 14:01:24 AEST 1989


In article <8468 at dasys1.UUCP> jpr at dasys1.UUCP (Jean-Pierre Radley) writes:
>Well, I just wasted a lot of time with one my programs because of the
>following:
>On the Tandy 6000, the stdio.h file says:
>	#define NULL	0
>But I just switched to a Tandy 4000, and the SCO 2.2.4 Xenix stdio.h says:
>	#define NULL	(char *)0
>"... standards, because there are so many ..."

Karl's advice was correct.

The second definition of NULL you exhibit above is ALMOST correct
but not quite.  It probably dates from before X3J11 specified clearly
what NULL had to be (before that, strictly speaking only the first
definition you exhibit was correct, but many implementors didn't
appreciate that).

What do you mean, "there are so many"?  Tandy Xenix implementations
are not C "standards" by any stretch of the imagination.



More information about the Comp.lang.c mailing list