Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!uunet!unisoft!greywolf From: greywolf@unisoft.UUCP (The Grey Wolf) Newsgroups: comp.lang.c Subject: Re: argv[] terminated by a NULL pointer? Message-ID: <3544@unisoft.UUCP> Date: 28 Jun 91 06:56:21 GMT References: <12187@hub.ucsb.edu> <14603@dog.ee.lbl.gov> Reply-To: greywolf@unisoft.UUCP (The Grey Wolf) Organization: Foo Bar and Grill Lines: 29 In article <14603@dog.ee.lbl.gov>, torek@elf.ee.lbl.com (Chris Torek) wrote: * In article <12187@hub.ucsb.edu> angst@cs.ucsb.edu * [argv terminated by null?] * * Under Version 6 Unix, argv[argc] is (char *)-1. This violates the * following wording from X3.159-1989 (`ANSI C'): * * argv[argc] shall be a null pointer. (2.1.1.2, p. 7) * * Thus, the answer to your question is both `no' and `yes'. "Never go to the Elves for counsel, for they will tell you both yes and no..." -- J.R.R. Tolkien You're sure holding true to form, Chris :-) ... Anyone got any clues why they started using NULL pointers instead of (char *) -1? Is there any system which will actually consider (char *) -1 a valid (virtual) memory location? Or, rather, WERE there any machines which would do so (were: most machines now are word-aligned). * -- * In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427) * Berkeley, CA Domain: torek@ee.lbl.gov -- # "Religion is a weapon invented by the sheep to keep the wolves in line." # greywolf@unisoft.com