Uninitialized externals and statics.

Mike McNelly mike at hpfcdc.HP.COM
Tue Aug 22 01:41:18 AEST 1989


> The default initialization of statics and externals without explicit inital
> values also has the advantage (at least on some systems) that the load
> module will be smaller.  If you explicitly initialize to zero, all those
> zeroes will be stored in the file.

Several years ago our HP 9000/Series 300 customers (rightly) complained
that those external and static variables that were explicitly
initialized to zero were taking up too much data space.  This is no
longer the case.  The necessary changes to the compiler were quite small
and easily accomplished.  Now our compiler puts these data items into
BSS just as though they were not explicitly initialized.

Not only does this change result in smaller executable files but it can
speed up compilation considerably.  Some of our biggest gains have been
in system code and in our graphics packages.

Mike McNelly
mike%hpfcla at hplabs.hp.com



More information about the Comp.lang.c mailing list