www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/02/11/07:13:06

Date: Sun, 11 Feb 1996 13:59:11 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp AT delorie DOT com
Subject: Re: Large automatic variables

>    At 06:36 PM 2/7/96 -0500, you wrote:
>    >   Date: Wed, 7 Feb 1996 16:20:14 CST (-0600)
>    >   From: cameronbuschardt <c027319 AT email4 DOT starnetinc DOT com>
>    >
>    >   At 02:49 PM 2/7/96 -0500, you wrote:
>    >   Thanx.. and one more question how come :
>    >   ..
>    >   long variable[1000000];
>    >
>    >   main()
>    >   {
>    >   ...
>    >   }
>    >   creates a 4mb exe!? is there a way to avoid this?
>    >   and how come

This only should happen in C++ programs.  You can use the 
`-fconserve-space' switch to GCC to avoid it, but then you sacrifice some 
of the compiler diagnostics.  Look up the description of this switch in 
the GCC docs for more details.

>    >   main()
>    >   {
>    >   long variable [1000000];
>    >   }
>    >
>    >   Gives me a runtime error? is it a bug?

This fragment requests a 1 MByte-long stack at run time.  If you run 
under DPMI, your default stack is fixed at 256KB max, unless you change 
it with the STUBEDIT program (which comes with DJGPP).

- Raw text -


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