On Thu, Jun 29, 2000 at 05:39:05PM -0400, Henry Spencer wrote:
> On Thu, 29 Jun 2000, Thomas Dickey wrote:
> > > > remember whether the C standard requires static variables to be
> > > > initialized to zero by the runtime environment...
> > > They require it.
> > 
> > I'm told that AIX's compiler does not necessarily do this for uninitialized
> > values...
> 
> That's curious, since it cannot conform to the C standard without doing so
> (the implicit initialization to zero is mandatory), and IBM was a strong
> supporter of the standard.  I would guess that this is a matter of either
> old compilers or compilers which mistakenly default to providing a
> non-standard C environment. 

or perhaps an odd linker behavior that doesn't ensure that bss is filled.
(my guess).
 
> Note a subtlety:  it's only *static* variables which get the implicit
> initialization to zero.  Local variables of functions don't, although it
> often happens by accident (since most kernels zero-fill newly-allocated
> stack memory) and some buggy programs rely on it. 

I understand about *static* variables.  But the patches that I recall for xterm
were static variables.  (Since I'm not debugging on AIX, I more/less have to
take their report seriously since there's more than one report).

-- 
Thomas E. Dickey <[EMAIL PROTECTED]>
http://dickey.his.com
ftp://dickey.his.com
-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/

Reply via email to