Xref: news2.mv.net comp.os.msdos.djgpp:2436 From: Denis Bernard Newsgroups: comp.os.msdos.djgpp Subject: Re: GCC v2 Date: Thu, 04 Apr 1996 09:24:41 -0500 Organization: Teleglobe Canada Inc. Lines: 24 Message-ID: <3163DBA9.3DD7@teleglobe.ca> References: NNTP-Posting-Host: bnet-gw.teleglobe.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Eli Zaretskii wrote: > > On Tue, 2 Apr 1996, Anthony Eguerre wrote: > > > An Other: > > main() > > {int t[800][800]; > > int i,j; > > for(j=0;j!=800;j++) > > for(i=0;i!=800;i++) > > t[j][i]=rand(); > > } > > result: Stack Fault... > > The GCC v2 dont like to big variables. > > Please read the DJGPP FAQ list (v2/faq200b.zip from the same place you > got DJGPP). It explains in section 15.8 that DJGPP programs by default > have a 256KByte-long stack. Your program defines a variable that takes > 800x800x4 = 2.56MBytes of stack, i.e. 10 times that much. To use such > large automatic variables, you should change the default stack size as > explained in the FAQ. A simpler solution would be to declare t[][] > outside `main', which will make it static. Or better yet, try malloc() :)