www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/02/07:49:47

Date: Tue, 2 Apr 1996 14:43:07 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Anthony Eguerre <eguerre AT clermont DOT inra DOT fr>
Cc: delorie <djgpp AT delorie DOT com>
Subject: Re: GCC v2
In-Reply-To: <3160F7B6.2BC7@clermont.inra.fr>
Message-Id: <Pine.SUN.3.91.960402143747.15070B@is>
Mime-Version: 1.0

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.

- Raw text -


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