Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: RE: if(p) Message-ID: <6116@utzoo.UUCP> Date: Mon, 4-Nov-85 20:04:41 EST Article-I.D.: utzoo.6116 Posted: Mon Nov 4 20:04:41 1985 Date-Received: Mon, 4-Nov-85 20:04:41 EST References: <1671@brl-tgr.UUCP> <30000017@ISM780.UUCP> <292@graffiti.UUCP> Organization: U of Toronto Zoology Lines: 24 > Um, treating an all-0 value as a pointer? But what operation do you do on > pointers apart from dereferencing that could be construed as doing something > with a *pointer* as opposed to doing something with a *variable*? ... The distinction you are drawing is not portable. You are assuming that one can treat something as a variable without implying a type. This is not necessarily true. It is conceivable, for example, that pointers are not the same size as any of the integer types, in which case manipulating them using integer instructions isn't possible. Or, as in the case John Bruner explained (which is the one I was thinking of), there are good reasons for *wanting* to use the instructions which know that the data item is a pointer. For example, I think on his machine it's not possible to load something into an address register without getting it checked for validity as a pointer, and doing things like pointer assignments while never using the address registers is awkward. No, you don't need an architecture radically unsuited to C to get conditions where all-0 is unsuitable as the NULL pointer. A slightly odd architecture with a bit more knowledge of datatypes than the usual ibm360/pdp11 clone is all it takes. Yes, software portability to and from such machines is meaningful and useful. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry