argv[] terminated by a NULL pointer?
The Grey Wolf
greywolf at unisoft.UUCP
Fri Jun 28 16:56:21 AEST 1991
In article <14603 at dog.ee.lbl.gov>, torek at elf.ee.lbl.com (Chris Torek) wrote:
* In article <12187 at hub.ucsb.edu> angst at 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 at ee.lbl.gov
--
# "Religion is a weapon invented by the sheep to keep the wolves in line."
# greywolf at unisoft.com
More information about the Comp.lang.c
mailing list