Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-lcc!mordor!styx!ames!ucbcad!ucbvax!ernie.Berkeley.EDU!rotondo From: rotondo@ernie.Berkeley.EDU (Scott Rotondo) Newsgroups: comp.lang.c Subject: Re: NULL pointers as arguments Message-ID: <18624@ucbvax.BERKELEY.EDU> Date: Tue, 28-Apr-87 22:33:06 EDT Article-I.D.: ucbvax.18624 Posted: Tue Apr 28 22:33:06 1987 Date-Received: Thu, 30-Apr-87 04:33:41 EDT References: <1130@ius2.cs.cmu.edu> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: rotondo@ernie.Berkeley.EDU.UUCP (Scott Rotondo) Distribution: na Organization: University of California, Berkeley Lines: 19 In article <1130@ius2.cs.cmu.edu> edw@ius2.cs.cmu.edu (Eddie Wyatt) writes: > It seems to me that the problems of having foo(NULL) be correct on > whatever machine you are working on could be taken care of by > having pointer arguements aways be type coerced into whatever the > largest pointer type is on the machine (in cases presented to > me that is char *). This could be done as part of the language > definition just as the float parameter are typed coerced into > doubles. This assumes there is some bound on pointer type sizes > though. Any comments? It also assumes that this pointer argument can be recognized as such. If NULL is (properly) defined as 0, it will look just like an integer by the time the compiler sees it. With a float this is not a problem unless you write something like 0 when you mean 0.0. By the way, it seems to me that there must be a bound on pointer type sizes. (One of them has to be the biggest.) -- Scott