Date: Thu, 9 Oct 1997 11:50:26 +0200 (IST) From: Eli Zaretskii To: "Salvador Eduardo Tropea (SET)" cc: Herman Geza , djgpp AT delorie DOT com Subject: Re: Compiler crashes... In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 8 Oct 1997, Salvador Eduardo Tropea (SET) wrote: > Bad news: > GCC doesn't support big arrays with initialization, like this: > > char XXX[100000]={ 1,2,.... > ... > ... 99999 }; > > The compiler will crash or if you have luck (like I have) it will > report out of virtual memory. Seems that gcc uses MUCH more memory > for this that what we can think. For example: 300000 elements needs > more than 40Mb. Are you sure? Can you post a short program that shows this problem? Testing with a program that I used (see below) indicates that it takes cc1 about 10MB to compile it. But I never had any crashes or "out of memory" messages. #include #include unsigned xxx[100000] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, /* 9,999 lines like this */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, .... .... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, }; int main (void) { return printf ("%d\n", xxx[rand() % 3] + xxx[rand() % 4]); }