Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!princeton!allegra!ulysses!faline!sabre!zeta!mb2c!edsdrd!edstb!msudoc!umich!jtr485 From: jtr485@umich.UUCP Newsgroups: comp.lang.c,comp.unix.questions Subject: Re: Question on large arrays in C Message-ID: <80@umich.UUCP> Date: Thu, 19-Feb-87 09:43:43 EST Article-I.D.: umich.80 Posted: Thu Feb 19 09:43:43 1987 Date-Received: Sat, 21-Feb-87 20:07:17 EST References: <1051@uwmacc.UUCP> <4124@utcsri.UUCP> <1514@ttrdc.UUCP> Organization: EECS, University of Michigan Lines: 21 Xref: watmath comp.lang.c:1108 comp.unix.questions:1124 In article <1514@ttrdc.UUCP>, levy@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