Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: Herman Geza , djgpp AT delorie DOT com Date: Wed, 8 Oct 1997 16:47:26 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Compiler crashes... Precedence: bulk Lantic wrote: > > My problem is very simple: I wrote a program which converts > bin files to C files. These C programs are perfect, they only > contain an array. If this array is small, about smaller than > 100.000 bytes, there is no problem. But, if it's bigger, the > compiler crashes with SIGSEGV. I used the option -v with > gcc, and I realized that the compiler wasn't able to make > the assembly file. A temporary file was made, and this file > contained about half of my array. I used CWSDPMI and I have > enough memory and winchester space. The TMP env was set right. > > So, I think everything was right, but the compiler crashed. > Please, HELP me! > 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. You can: 1) Avoid it in the code. You can attach the data to the exe or better load it from a file. 2) Make it in small arrays. SET ------------------------------------ 0 -------------------------------- Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013