www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/05/12:48:27

From: kagel AT quasar DOT bloomberg DOT com
Date: Mon, 5 Aug 1996 12:38:37 -0400
Message-Id: <9608051638.AA01596@quasar.bloomberg.com >
To: j DOT aldrich6 AT genie DOT com
Cc: lav AT video DOT yars DOT free DOT net, djgpp AT delorie DOT com
In-Reply-To: <199608022355.AA030490115@relay1.geis.com> (j.aldrich6@genie.com)
Subject: Re: Compile Errors
Reply-To: kagel AT dg1 DOT bloomberg DOT com

   Errors-To: postmaster AT ns1
   From: j DOT aldrich6 AT genie DOT com
   Date: Fri,  2 Aug 96 23:29:00 UTC 0000
   Cc: djgpp AT delorie DOT com
   X-Genie-Qk-From: J.ALDRICH6
   X-Genie-Qk-Id: 7658497
   X-Genie-Gateway-Id: 312996
   Mime-Version: 1.0
   Content-Transfer-Encoding: 7bit
   Content-Type: text/plain; charset=us-ascii
   Content-Length: 494

   Reply to message 9471561    from LAV AT VIDEO DOT YAR on 08/02/96  1:06PM


   >> > Almost, actually there is a third valid definition for main():
   >> >
   >> > 	int main( int argc, char **argv, char **environment )
   >
   >This is not a valid definition (at least not standard). It is used in
   >borland c, though.

   I always thought that you could just get environment vars using
   getenv().  Why add an extra complication to program initialization,
   even if it is valid?

   Does the above even work under DJGPP?

It definitely works in GCC in general.  I see no reason why DJ et al. should
have broken this feature, though I have not used it in DJGPP myself.

Admittedly this feature has limited value as you only have access to the
arguments to main() in main() while getenv() is available anywhere.  I do not
tend to use the third argument to main() myself for this reason, but the point
was just to point out that there were not "Only two valid declarations" for
main(), there is a third one, which is, though eminently usable, not
particularly useful.

-- 
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com

A proverb is no proverb to you 'till life has illustrated it.  -- John Keats

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019