Xref: utzoo alt.sources:370 comp.lang.c:15877 Checksum: 29693 Path: utzoo!utgpu!woods From: woods@gpu.utcs.toronto.edu (Greg Woods) Date: Mon, 30-Jan-89 01:39:36 EST Message-ID: <1989Jan30.013936.11995@gpu.utcs.toronto.edu> Organization: Elegant Communications, Inc. Newsgroups: alt.sources,comp.lang.c Subject: Re: uustatus - realtime uustat for HDB uucp (w/findpath) Summary: NULL is zero. (period!) References: <1167@unisec.usi.com> <5312@turnkey.TCC.COM> Reply-To: woods@gpu.utcs.Toronto.EDU (Greg Woods) Followup-To: comp.lang.c Keywords: NULL zero 0 C Microsoft In article <5312@turnkey.TCC.COM> sandy@turnkey.TCC.COM (Sanford 'Sandy' Zelkovitz) writes: > [...] There is another change that should be made and > that is to change one of the NULL entries to a zero (0). This will remove > the only warning message that the compiler prints out. What I'm about to say is really just a flame, but at the same time, I don't want to start a war either. This is posted, instead of being mailed, out of general frustration at a very obvious mis-understanding that has perpetuated itself for far too long. The reason your compiler gives you a warning message, is because NULL has been erroneously defined as something other than just plain zero. I most definitely will not go into the reasons why, but it should suffice to say that "#define NULL 0" is the only correct definition. [Anyone who would like some evidence, please send me some mail.] The only unfortunate side-effect of this is the potential breaking of any programmes that were written with the assumption that NULL is defined as something other than zero. As another point of warning, be careful of the Microsoft C iAPX86 compiler that you are most likely using with your version of Xenix. Some versions of this compiler do not properly perform pointer arithmetic with zero, unless it is cast to a pointer type. -- Greg Woods. {utgpu,lsuc!gate,ontmoh}!woods, woods@{gpu.utcs.Toronto.EDU,utorgpu.BITNET} 1-416-443-1734 [h], 1-416-595-5425 [w] LOCATION: Toronto, Ontario, Canada