Path: utzoo!attcan!utgpu!watmath!att!dptg!rutgers!apple!gem.mps.ohio-state.edu!wuarchive!uwm.edu!csd4.csd.uwm.edu!chad From: chad@csd4.csd.uwm.edu (D. Chadwick Gibbons) Newsgroups: comp.lang.c Subject: Re: Abandon NULL for (0) Keywords: NULL, nil Message-ID: <151@uwm.edu> Date: 21 Sep 89 19:01:10 GMT References: <6502@ux.cs.man.ac.uk> <14718@bfmny0.UU.NET> Sender: news@uwm.edu Reply-To: chad@csd4.csd.uwm.edu (D. Chadwick Gibbons) Organization: University of Wisconsin-Milwaukee Lines: 24 In article <14718@bfmny0.UU.NET> tneff@bfmny0.UU.NET (Tom Neff) writes: |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. So? When 0 used in a comparison with a pointer, it is automatically promoted to an integer pointer of an appropriate type. |declare or define, an external routine that accepts a single pointer as |its argument, by saying myproc((0)), the compiler will Miranda it into a |regular int, rather that ((void *) 0), which might have a different size |and representation. yeah, talk about assuming sizeof * = sizeof int. Nononono! If you're really parinoid about using NULL, because your compiler may do something like the above person is suggestion, then try this: #define NIL (0) simple, no?