Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Tek) 9/26/83; site azure.UUCP Path: utzoo!linus!decvax!tektronix!teklds!azure!grahamr From: grahamr@azure.UUCP (Graham Ross) Newsgroups: net.lang.c Subject: Re: Must a NULL pointer be a 0 bit pattern? Message-ID: <100@azure.UUCP> Date: Wed, 31-Oct-84 12:51:46 EST Article-I.D.: azure.100 Posted: Wed Oct 31 12:51:46 1984 Date-Received: Fri, 2-Nov-84 05:32:21 EST References: <6542@mordor.UUCP> <5272@brl-tgr.ARPA> <196@rlgvax.UUCP>, <529@wjh12.UUCP> Organization: Tektronix, Beaverton OR Lines: 19 Three comments about non-zero NULL: 1. Because of implicit comparison with zero, as in "while(p)s;", this idea is cannot be implemented simply by changing stdio.h to read #define NULL ((char*)0x87654321) 2. In making changes to the compiler, this must remain zero: (p = NULL , (int)p) Also, for every declared "var", this must remain one: (p = &var , (int)p != 0) 3. The issue of how a union can be set to zero was handled properly by the correspondent who said the first member is initialized to zero. A further note might be made that exec(2) need not know where to put the 0x87654321 patterns; crt0 or something emitted by the linker can do this, but perhaps with a substantial amount of work and/or abandonment by Unix of the "common model" for linking. Graham Ross, Tektronix, ...!tektronix!tekmdp!grahamr