Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site cbosgd.UUCP Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!floyd!harpo!eagle!mhuxl!cbosgd!mark From: mark@cbosgd.UUCP Newsgroups: net.unix-wizards,net.bugs.4bsd Subject: Re: Please use NULL instead of 0 whenever you have a pointer! Message-ID: <858@cbosgd.UUCP> Date: Tue, 24-Jan-84 13:44:21 EST Article-I.D.: cbosgd.858 Posted: Tue Jan 24 13:44:21 1984 Date-Received: Fri, 27-Jan-84 08:25:04 EST References: <210@basserva.UUCP>, <151@ttds.UUCP> <218@basservax.SUN> Organization: AT&T Bell Laboratories, Columbus Lines: 17 If NULL and 0 are supposed to be the same, please explain what proper behavior is in the following situation: execl("/bin/echo", "echo", "hi", "there", 0); (This is the way it's documented in exec(2) and used everywhere.) Now, suppose you have a system where ints are 16 bits and char *'s are 32 bits. (Hmm, sounds like a 68000.) Now, it's clear we have a series of 32 bit values on the stack, followed by a 16 bit zero, followed (if you keep looking) by garbage. The only clean solution I know of (other than using 32 bit ints, which is inefficient) is to use NULL and have NULL be (void *) 0. This is obviously pretty painful, given all those programs out there that use exec. Considering that it's quite reasonable for either the high 16 bits or the low 16 bits of a valid 32 bit pointer to be zero, is there some other reasonable way to handle this?