Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!ut-sally!husc6!cmcl2!brl-adm!brl-smoke!gwyn
From: gwyn@brl-smoke.ARPA (Doug Gwyn )
Newsgroups: comp.lang.c
Subject: Re: Accessing argc/argv/envp
Message-ID: <6186@brl-smoke.ARPA>
Date: Tue, 28-Jul-87 13:02:58 EDT
Article-I.D.: brl-smok.6186
Posted: Tue Jul 28 13:02:58 1987
Date-Received: Thu, 30-Jul-87 00:48:48 EDT
References: <22@flmis06.ATT.COM> <28700015@ccvaxa> <420@sugar.UUCP> <548@whuxm.UUCP>
Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) )
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 14

In article <548@whuxm.UUCP> davew@whuxm.UUCP (WONNACOTT) writes:
>... I've heard its a good idea to use environ instead of envp because
>non-un*x systems are more likely to have environ than envp.

This business was juggled for a while by the IEEE P1003 and ANSI X3J11
standards committees.  The outcome was that an X3.159-compliant program
cannot expect envp, and furthermore it is possible that some
implementations simply cannot support both 2- and 3-argument main()
functions with a single approach.  (The latter argument is weakened by
the decision to allow a 0-argument main(), which would force special
compiler kludgery anyway.  I think 0-argument main() weakens the goal
of encouraging type correctness.)  The 2-argument form was chosen as
more in line with existing practice, plus we observed that the environ
variable provides a superset of the envp functionality.