www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/16/16:53:30

Date: Mon, 16 Sep 1996 20:33:51 -0300
Message-Id: <1.5.4.16.19960916173527.29e7e9f6@dmeasc.rc.ipt.br>
Mime-Version: 1.0
To: Samuel Vincent <svincent AT zippy DOT sonoma DOT edu>,
Cesar Scarpini Rabak <csrabak AT dce03 DOT ipt DOT br>
From: Cesar Scarpini Rabak <csrabak AT dce03 DOT ipt DOT br>
Subject: Re: Possible static data zeroisation bug in DJGPP v2?
Cc: kagel AT dg1 DOT bloomberg DOT com, thoni AT softlab DOT se, djgpp AT delorie DOT com

At 13:16 16/09/96 -0700, Samuel Vincent wrote:
>On Mon, 16 Sep 1996, Cesar Scarpini Rabak wrote:
>
>> Excerpt from K&R Book 2nd ed. pg 40: 
>> "...External and static variables are initialized to zero by default."
>> 
>> I have no ANSI/ISO standard handy by now, but it is on the standard as well
>> (I think on section four).
>
>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.

>
>As far as static variables go, I don't have that info available, but
>it would make sense to zero it yourself anyway.  I believe ANSI says
>absolutely nothing is initialized unless you do it yourself.
>

Sorry, but the Standard says the converse.

>-Sam
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cesar Scarpini Rabak                      E-mail: csrabak AT ipt DOT br
DME/ASC                                   Phone: 55-11-268-35221Ext.350
IPT - Instituto de Pesquisas Tecnologicas Fax:   55-11-268-5996
Av. Prof. Almeida Prado, 532.  Sao Paulo - SP 05508-901 BRAZIL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Raw text -


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