From: "Christopher R. Hertel" <crh@NTS.Umn.EDU> Message-Id: <199805100218.VAA29295@unet.unet.umn.edu> Subject: Re: coding standards To: lkcl@switchboard.net (Luke Kenneth Casson Leighton) Date: Sat, 9 May 1998 21:18:39 -0500 (CDT) In-Reply-To: <Pine.NEB.3.96.980509141301.6313D-100000@cb1-gw.cb1.com> from "Luke Kenneth Casson Leighton" at May 9, 98 02:14:44 pm
>
> > As Andrew pointed out to me, the C standard does define NULL as a pointer
> > with a value of zero. void *ptr = 0 isn't wrong, per se., it's just that
> > it's much clearer to use NULL.
>
> > #define NULL ((void*)0)
>
> the atari lattice c compiler used to crash because of this (quite normal)
> #define. i vaguely recall assigning an int (which defaulted to 16 bit on
> a 68000 processor) to NULL which caused the compiler-crash: i was used to
> decent compilers that define int to be 32 bit :-) :-)
>
Well, assigning NULL to an int...
Still, by using NULL, you should be guarunteed the correct data type for
*pointers*.
-- Christopher R. Hertel -)----- University of Minnesota crh@nts.umn.edu Networking and Telecommunications Services