www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/26/06:23:35

Date: Wed, 26 Nov 1997 13:21:49 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: sl <SL AT usemail DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Excessive exe sizes
In-Reply-To: <199711252342.BAA29941@is.elta.co.il>
Message-ID: <Pine.SUN.3.91.971126132047.960G-100000@is>
MIME-Version: 1.0

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.

- Raw text -


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