Question on large arrays in C

jtr485 at umich.UUCP jtr485 at umich.UUCP
Fri Feb 20 00:43:43 AEST 1987


In article <1514 at ttrdc.UUCP>, levy at ttrdc.UUCP writes:
> This will also result in an elephantine (HUGE) executable file on many
> systems (if the compile gets that far, and doesn't run out of temp-file
> ulimit or space first).  An extern (explicit, or implicitly so by being
> declared outside of a function) does not have this problem (it will go
> in bss) though it will no longer be hidden.

Why doesn't this have the same problem?  Statics and externs should have the
same allocation semantics, only the static scope of the variables should be
different.
> 					  A "static" declaration in C,
> either inside or outside of a function, I have found to result in each
> and every byte being initialized data.  Ugh.
>--dan levy

Then you have been dealing with some VERY POOR compilers.  Allocating code file
space for bss data which gets initialized to 0 is absurd, since it is trivial
to build prologue code (which will probably run faster than loading from disk)
to handle this.

--j.a.tainter



More information about the Comp.lang.c mailing list