Newsgroups: comp.lang.c
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!dog.ee.lbl.gov!elf.ee.lbl.gov!torek
From: torek@elf.ee.lbl.gov (Chris Torek)
Subject: Re: argv[] terminated by a NULL pointer?
Organization: Lawrence Berkeley Laboratory, Berkeley
References: <12187@hub.ucsb.edu>
Message-ID: <14603@dog.ee.lbl.gov>
X-Local-Date: Sun, 23 Jun 91 17:57:42 PDT
Reply-To: torek@elf.ee.lbl.gov (Chris Torek)
Date: Mon, 24 Jun 91 00:57:42 GMT

In article <12187@hub.ucsb.edu> angst@cs.ucsb.edu
(Hopelessly in love w/Donna Reed) writes:
>I'm porting some code that assumes that the argv[] array is terminated
>by a NULL pointer....  am I right in my belief that argv[] is not
>*guaranteed* to be terminated by a NULL pointer?  

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'.
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427)
Berkeley, CA		Domain:	torek@ee.lbl.gov
