Newsgroups: comp.lang.c Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: void * compatibility Message-ID: <1990Sep23.002428.16099@zoo.toronto.edu> Organization: U of Toronto Zoology References: <8770@b11.ingr.com> <26628@mimsy.umd.edu> Date: Sun, 23 Sep 90 00:24:28 GMT In article <26628@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes: >Personally, I think defining NULL as (void *)0 is foolishness: if you >want your compiler to provide complete error checking, you should define >it as `__nil' and make __nil a keyword. Using (void *)0 fixes a few >specific problems, but leaves others unfixed and unfixable. Actually, the Rationale for ANSI C makes it clear that error checking had nothing to do with making `(void *)0' an official null pointer. The motive was to provide for a NULL of the same size as most pointers -- thereby minimizing breakage of old defective code -- on machines where there is no integer type of the right size. Minimizing breakage is also the reason why (e.g.) `0L' is also a legal NULL, for machines where pointers are the size of longs rather than ints. -- TCP/IP: handling tomorrow's loads today| Henry Spencer at U of Toronto Zoology OSI: handling yesterday's loads someday| henry@zoo.toronto.edu utzoo!henry