delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/19/12:04:53

From: Thomas Nilsson <thoni AT softlab DOT se>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Possible static data zeroisation bug in DJGPP v2?
Date: Thu, 19 Sep 1996 01:20:27 +0200
Organization: SoftLab
Lines: 36
Message-ID: <324083BB.41C67EA6@softlab.se>
References: <199609170118 DOT VAA20545 AT delorie DOT com>
NNTP-Posting-Host: lion.softlab.se
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

DJ Delorie wrote:
> 
> * If you have any static, but uninitialized variables, like these:
> 
>         int q;
>         char foo[500];
> 
>   then the DJGPP startup will guarantee that they start off with
>   binary zeros in them.  This is required by ANSI, and thus it is so.
> 

Right.

However the issue has been resolved (it was an indexing problem caused
by char being signed in DJGPP by default). The hassle to find the
thrashing was caused by having a public variable named the same as the
module in which the static data was declared. Thus it was not possible
to display it using gdb even using the filename, and I was not
previously aware that gcc placed symbol information about module-static
data only in scopes where it was referenced (it did work to just add a
dummy reference in any function, the structure was then suddenly
"available in the current scope").

Well, as well...

	Thomas

-- 
"Little languages go a long way..."
(ThoNi of ThoNi&GorFo Adventure Factories in 1985)
--------------------------------------------------------------------------------
Thomas Nilsson				Phone Int.: (+46) 13 12 11 67
Stenbrötsgatan 57			Phone Nat.: 013 - 12 11 67
S-582 47 LINKÖPING 			Email: thoni AT softlab DOT se
SWEDEN					alan-request AT softlab DOT se for info
--------------------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019