Message-Id: <199609170209.TAA03278@bluesky.com> Comments: Authenticated sender is From: "Kevin Baca" To: djgpp AT delorie DOT com Date: Mon, 16 Sep 1996 19:12:19 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Possible static data zeroisation bug in DJGPP v2? > > >You must forgive me for my disbelief, but how can an "external" variable > > >be initialized at all? It's initialized elsewhere, where it is > > >defined, not declared (externally declared or not...) > > > Have you heard about a piece of code that runs BEFORE the very fisrt line of > > your program runs (in DJGPP is in crt0.o...) the C Run Time start up code? > > > One of its functions is precisely to do this chore. > > Correct me if I'm wrong, but wasn't this changed so that it _did not_ zero > the code for performance reasons? (I actually think this was part of Quake > ie: id needed some more performance, so taking out the zeroing of allocated > memory was used to help speed things up a bit). I think you now specify that > you want it zeroed as part of the __crt0_startup_flags (I cant verify this, > I have never needed to test it) That only applies to dynamic memory (e.g. memory allocated with malloc). -Kevin