Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site celtics.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!bu-cs!celtics!roger From: roger@celtics.UUCP (Roger Klorese) Newsgroups: net.lang.c Subject: Re: if (p) ... Message-ID: <916@celtics.UUCP> Date: Wed, 16-Oct-85 18:08:40 EDT Article-I.D.: celtics.916 Posted: Wed Oct 16 18:08:40 1985 Date-Received: Sun, 20-Oct-85 04:30:25 EDT References: <2098@brl-tgr.ARPA> Reply-To: roger@celtics.UUCP (Roger Klorese) Organization: Celerity Computing (Eastern Region), Framingham, MA Lines: 31 Summary: In article <2098@brl-tgr.ARPA> harged%ti-eg.csnet@CSNET-RELAY.ARPA (Richard_Hargrove) writes: > >means, whether it is good style, &c... is overlooking something. >Nowhere in K & R is the meaning of the distinguished constant >NULL defined. I thought its definition was implementation >dependent. It just so happens that all implementations I know of >use 0 (or 0L). But nothing *requires* this. In fact, I've worked in an environment (PRIMOS and other Multics-style systems) with segmented addressing schemes (and demand-paged virtual memory) wherein the definition of a NULL pointer was any address in the designated-highest- possible segment (defined as octal 7777). Thus, for C to see a pointer as null required conversion from 7777/0 to 0 (or seg 0 loc 0, which is a valid address) and back again! In summary: YEAH, a portable test is necessary that does not depend on NULL being ZERO. -- -------------------------------------------------------------------------------- | ... "What were you expecting, rock'n'roll?" | |Roger B.A. Klorese | |Celerity Computing, 40 Speen St., Framingham, MA 01701, (617) 872-1772 | |UUCP: ARPA: | |decvax-\ bang-\ celerity!celtics!roger@sdcsvax.ARPA | |ucbvax--\ akgua-\ | |ihnp4----\-sdcsvax-\-celerity!celtics!roger - or - | |- or - celtics!roger@bu-cs.ARPA | |seismo----\harvard---\bu-cs!celtics!roger | --------------------------------------------------------------------------------