Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!uwvax!oddjob!hao!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: <3673@gitpyr.gatech.EDU> Date: Mon, 1-Jun-87 14:39:35 EDT Article-I.D.: gitpyr.3673 Posted: Mon Jun 1 14:39:35 1987 Date-Received: Wed, 3-Jun-87 01:18:47 EDT References: <158@delftcc.UUCP> Organization: Georgia Institute of Technology Lines: 28 Keywords: C, NULL, portability Summary: PRIME 9955 has NULL equal to 0x60000000 and if(p) is not the same as if(p != NULL) In article <158@delftcc.UUCP>, henry@delftcc.UUCP (Henry Rabinowitz) writes: > In such an implementation, does > char *p; p = (char *)0; > result in p having the special null value? How is NULL defined? > > Are static pointers initialized to all bits zero or to the null value > (as in ANSI spec)? > > In such an implementation, can you use the conventional abbreviation > if (p) > to mean > if (p != NULL) On the PRIME system under PRIMIX, there is a special "undefined pointer" value. This value is used by the procedure call mechanism when fewer arguments are passed to a subroutine by reference (ie FORTRAN) than 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