Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!rutgers!lll-lcc!pyramid!batcomputer!garry From: garry@batcomputer.tn.cornell.edu (Garry Wiegand) Newsgroups: comp.lang.c Subject: Re: Query: Implementation with non-zero NULL Message-ID: <1217@batcomputer.tn.cornell.edu> Date: Sat, 30-May-87 00:01:11 EDT Article-I.D.: batcompu.1217 Posted: Sat May 30 00:01:11 1987 Date-Received: Sun, 31-May-87 19:38:22 EDT Reply-To: garry@oak.cadif.cornell.edu Organization: Cornell Engineering && Flying Moose Graphics Lines: 30 In a recent article henry@delftcc.UUCP (Henry Rabinowitz) wrote: >I'm writing a book on C portability. Interested to find actual >implementation of C where the null pointer is not "all bits zero." And I'd be interested in knowing what difference it could ever make to a portable program: the only ways I know to look at the bits is to union the pointer with an integer (and load the pointer & look at the integer), or to cast the pointer to an integer. Both of which would be very forbidden in portable code. >Are static pointers initialized to all bits zero or to the null value >(as in ANSI spec)? You should NEVER assume a not-explicitly-initialized static variable is given any particular value by anybody. Note: I have not yet seen a compiler written to the ANSI spec. Talking about porting between ANSI-spec compilers is not a very interesting thing to do, and won't be for a while (five years, maybe?) >In such an implementation, can you use the conventional abbreviation > if (p) >to mean > if (p != NULL) Um, might I suggest that this book project is not really a good idea for you? And the world? (Please see K&R on the meaning of 'if(p)'). garry wiegand (garry@oak.cadif.cornell.edu - ARPA) (garry@crnlthry - BITNET)