Null revisited (briefly)

Leslie Mikesell les at chinet.chi.il.us
Sun Feb 5 08:01:32 AEST 1989


In article <13068 at steinmetz.ge.com> davidsen at crdos1.UUCP (bill davidsen) writes:

>A portable program will not assume that it is an int or a pointer, but
>will use it in ways which do not make any assumptions as to type. 

Does the (IMHO) incorrect cast of NULL to (char *) in some compilers
stdio.h hurt anything in a correctly written program?  That is, does
(char *)0 become something other than 0 in the context of an assignment
or comparison, and is it treated differently when cast to the correct
type (perhaps (int *)(char *)0 or (struct foo *)(char *)0)?

Les Mikesell



More information about the Comp.lang.c mailing list