Date: Sun, 11 Feb 1996 13:59:11 +0200 (IST) From: Eli Zaretskii 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 > > > > 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).