Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!linus!gatech!gitpyr!allen From: allen@gitpyr.gatech.EDU (P. Allen Jensen) Newsgroups: comp.lang.c Subject: Re: Query: Implementation with non-zero NULL Message-ID: <3675@gitpyr.gatech.EDU> Date: Mon, 1-Jun-87 14:54:56 EDT Article-I.D.: gitpyr.3675 Posted: Mon Jun 1 14:54:56 1987 Date-Received: Wed, 3-Jun-87 01:49:23 EDT References: <158@delftcc.UUCP> <3673@gitpyr.gatech.EDU> Organization: Georgia Institute of Technology Lines: 18 Keywords: C, NULL, portability Summary: CORRECTION TO PREVIOUS REPLY In article <3673@gitpyr.gatech.EDU>, allen@gitpyr.gatech.EDU (P. Allen Jensen) writes: > are expected. Because of this, constructs such as the > if(p) > Do not yield correct results. The prime also has modes of operation in which > pointers are 48 bits even though long, int and float are all 32 bits. > This is a hold-over from the segmented addressing of the older 16 bit primes. > The value of NULL is 0x60000000 on a prime. > > P. Allen Jensen Correction - if(p) yields false if p = (char *) NULL Also, if(p != 0) also yields false. The 0 is cast to (char *). The value of 0x60000000 is correct. If you do a union with a long and compare the long with zero (0), they will not be equal. Also, since in some modes a pointer may be 48 bits, you would only get the first 32 bits in the union. P. Allen Jensen