From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11390f,4c42ac518eba0bbe X-Google-Attributes: gid11390f,public X-Google-Thread: 109fba,4c42ac518eba0bbe X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,4c42ac518eba0bbe X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,4c42ac518eba0bbe X-Google-Attributes: gid1014db,public From: "Shmuel (Seymour J.) Metz" Subject: Re: Programming language vote - results Date: 1997/11/28 Message-ID: <347F1CAC.6602@gsg.eds.com>#1/1 X-Deja-AN: 293501583 References: <347440AD.35DF@idt.net> <65di3v$730$1@news1.ucsd.edu> <347C420A.2B18@sensor.com> <65ih8m$pqt$1@news1.ucsd.edu> Organization: EDS MS Reply-To: nospam@gsg.eds.com Newsgroups: comp.lang.ada,comp.lang.apl,comp.lang.c,comp.lang.c++ Date: 1997-11-28T00:00:00+00:00 List-Id: William Tanksley wrote: > NULL is defined as "(void*)0". I've never seen a compiler which failed to > have (int)NULL be equal to 0 as well, but seeing one would not shock me -- > according to K&R 2 (I don't have ANS C available right now) ANS doesn't > explicitly require that. > > The worst part of that code, as far as I'm concerned, isn't the use of > pointers as booleans; after all, I can't imagine why a vendor would EVER > make non-zero NULL returns, The obvious reason is to ensure that attempts to use a null pointer to access data will be trapped, instead of producing spurious output or storage overlays. Of course, if the low end of the address space is guarantied to be invalid, then the value 0 will accomplish that, but often 0 is a valid address. Shmuel (Seymour J.) Metz -- Shmuel (Seymour J.) Metz Senior Software SE The values in from and reply-to are for the benefit of spammers: reply to domain eds.com, user msustys1.smetz or to domain gsg.eds.com, user smetz. Do not reply to spamtrap@library.lspace.org