Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!pacbell!ames!mailrus!tut.cis.ohio-state.edu!husc6!cca!g-rh From: g-rh@cca.CCA.COM (Richard Harter) Newsgroups: comp.lang.c Subject: Re: Header problems Message-ID: <25398@cca.CCA.COM> Date: 8 Mar 88 23:40:10 GMT References: <2550049@hpisod2.HP.COM> <7412@brl-smoke.ARPA> <3351@chinet.UUCP> Reply-To: g-rh@CCA.CCA.COM.UUCP (Richard Harter) Organization: Computer Corp. of America, Cambridge, MA Lines: 22 In article <3351@chinet.UUCP> dag@chinet.UUCP (Daniel A. Glasser) writes: >In article <7412@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: > >Your use of NULL === 0 promotes unportable code, and is considered to be >bad programming style in a world where portability across multiple machine >architectures (ie, PDP-11, VAX-11, M680x0, I80x86 and Z800x) is required >for commercial reasons. > This comes up regularly. There is nothing wrong defining NULL as 0; it does not make for non-portability. The fault lies in passing NULL as an uncasted pointer across a calling sequence. Since lint will tell you about this, there is no good reason for this happening. In actual fact, I am wary of using (void *)0 for portability reasons -- I don't know (and don't care) if all implementations that I have to deal with handle it correctly. I do know that all implementations handle (proper_type *)0 correctly. [Actually I don't know that, but I've never seen it fail.] -- In the fields of Hell where the grass grows high Are the graves of dreams allowed to die. Richard Harter, SMDS Inc.