Why isn't argv[argc]==(char *)0 ?

Martin Weitzel martin at mwtech.UUCP
Fri Nov 24 22:02:13 AEST 1989


In article <1989 at uwbull.uwbln.UUCP> ckl at uwbln.UUCP (Christoph Kuenkel) writes:
[some lines deleted]
>which is SVID conformant.  as mentioned before, the SVID does not say 
>anything about argv[argc] but states that
>
>	"argc is the argument count, argv is an array of character pointers
>	 to the argument themselves"

My personal opinion is, that the SVID just did forget to mention.
I conclude this from
 a) SVID has several weak points (some errors also)
 b) On the pages you quote from, I also found nothing about
    how "envp" is terminated.
"envp" is by convention (char *)0 too, and I think this is true on
*all* systems, because how would you know otherwise, when to terminate
stepping thru "envp"? There is no such thing as "envc"! You may argue,
that it is not intended stepping thru "envp" rather use "getenv()" and
that this function may have a secret way to determine when to stop.
But then, why mention "envp" as formal parameter of "main" at all?

Last and final: From the very beginning SVID stated, they will strongly
consider full conformance to X3J11 - and X3J11 has no doubt about that
argv[argc] is a null pointer.

MW



More information about the Comp.unix.wizards mailing list