Mail Archives: djgpp/1997/11/26/06:23:35
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 -