Path: utzoo!attcan!uunet!wuarchive!gem.mps.ohio-state.edu!apple!sun-barr!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c Subject: Re: Abandon NULL for (0) Message-ID: <8241@goofy.megatest.UUCP> Date: 22 Sep 89 21:00:47 GMT References: <14718@bfmny0.UU.NET> Organization: Megatest Corporation, San Jose, Ca Lines: 21 From article <14718@bfmny0.UU.NET>, by tneff@bfmny0.UU.NET (Tom Neff): > In article <6502@ux.cs.man.ac.uk> ian@ux.cs.man.ac.uk (Ian Cottam) writes: >> I propose that the integral constant expression (0) be used instead of >> NULL. > > However (0) is not explicitly cast to a pointer type, as NULL may be > presumed to be when appropriate. Presume all you want, but that won't cast it. I cut this directly out of Sun-3's stdio.h: #define NULL 0 It's the same in BSD-4.2. NULL is turned into 0 by the preprocessor before the compiler proper ever sees it. NULL is an SLM (silly little macro) that means 0. This topic comes up in this group every now and then. After all the arguing is over -- and it can take months -- the survivers come to the conclusion that NULL is a mistake, but it's too late to correct it. Just say, (FILE*)0, or (char*)0, or whatever.