Date: Wed, 26 Nov 1997 13:21:49 +0200 (IST) From: Eli Zaretskii To: sl cc: djgpp AT delorie DOT com Subject: Re: Excessive exe sizes In-Reply-To: <199711252342.BAA29941@is.elta.co.il> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 25 Nov 1997, sl wrote: > >This cannot be done in all cases. For example, if the array is > >initialized by values other than zeroes, the linker has no other way > >than to write all those values into the disk .exe file. > > But if the array is declared but NOT initialized it is dumb to > store tons of zeros in the EXE. That should be optimized out. This thread has repeatedly pointed to a section in the DJGPP FAQ list which explains that (1) in C programs uninitialized arrays are NOT stored, exactly as you want it; (2) in C++ programs there is a potential problem with multiple definitions of the same array that could crash your program, and that GCC makes you a service by storing the array which avoids such crashes; and (3) there's a switch that prevents GCC from doing this even in C++ programs. Could you please make a habit of reading the FAQ pointers before you make up your mind about people and compilers? Thanks.