Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.lang.c Subject: Re: RE: if(p) Message-ID: <2902@sun.uucp> Date: Thu, 17-Oct-85 05:22:47 EDT Article-I.D.: sun.2902 Posted: Thu Oct 17 05:22:47 1985 Date-Received: Sat, 19-Oct-85 05:43:23 EDT References: <1671@brl-tgr.UUCP> <30000017@ISM780.UUCP> <292@graffiti.UUCP> Organization: Sun Microsystems, Inc. Lines: 12 > What's wrong with this? It's identical to "if(p==(foo *)i)" according to the > default expression evaluation rules. Any special meaning of 0 should be > handled in the evaluation of (foo *)i. No, it shouldn't. According to K&R, the rules for conversion between pointers and integers are machine-dependent but are supposed to be "unsurprising". I'd be surprised as hell if, assuming a null pointer had some value other than all zero bits, this conversion produced a null pointer if i is zero. K&R takes great pains to insist that the interpretation of 0 as a null pointer is only to be taken if the 0 is a *constant* 0. Guy Harris