From: Paul Shirley Newsgroups: comp.os.msdos.djgpp Subject: Re: 3k lines = 4 MEG!! EXE ?? Help Date: Sun, 25 Jan 1998 17:32:50 +0000 Organization: wot? me? Distribution: world Message-ID: References: <34C4B1C1 DOT 51D2 AT netunlimited DOT net> <34C5716C DOT 541A AT cs DOT com> <885719592 DOT 215815 AT diamond DOT gem DOT co DOT za> Reply-To: Paul Shirley NNTP-Posting-Host: chocolat.foobar.co.uk Mime-Version: 1.0 Lines: 24 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article <885719592 DOT 215815 AT diamond DOT gem DOT co DOT za>, Deepblade writes > >As I see it, prefixing a global array declaration with the word 'static' >stops gcc from building huge files. > > >I've been using this for ages, and it has always worked for me. >Is it a bad idea? If it successfully punts arrays into BSS then there's no problem. As long as you understand the implications of using static on global variables (they are no longer visible to external modules). >I know I should probably use dynamic allocation, but I'm lazy ;-) One possible advantage is that you will get the chance to recover if a dynamic allocation fails. If you are lucky a failed BSS allocation will just prevent your program starting (bad), conceivably a bad compiler would let your code run and crash (very bad). --- Paul Shirley: my email address is 'obvious'ly anti-spammed