Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!ukma!mailrus!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.lang.c Subject: Re: How big is the argv[] array? Summary: argv[argc] may not be NULL Message-ID: <4206@bsu-cs.UUCP> Date: 5 Oct 88 16:26:43 GMT References: <1239500004@osiris.cso.uiuc.edu> <8631@smoke.ARPA> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 21 In article <8631@smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >argv[argc] is supposed to be a null pointer... >Some older systems did >not have a null pointer in argv[argc], however. I don't think >you're likely to encounter any such systems today. Since this is comp.lang.c and not a UNIX newsgroup, the following footnote from "Advanced UNIX Programming" by Marc J. Rochkind (p 105) is relevant: "The C Programming Language" does not state anywhere that argv[argc] is NULL. Neither do most UNIX manuals. So it's unwise to assume that argv is terminated with NULL, because in non-UNIX systems or in UNIX clones it may not be true. (Does ANSI C make argv[argc] valid? Even so, ANSI-conformant compilers will not be universally available for some years.) There are so many different non-UNIX C implementations around that a defensive programmer will avoid assuming too much that is not in K&R. -- Rahul Dhesi UUCP: !{iuvax,pur-ee}!bsu-cs!dhesi