[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sysval and doc fixes
From: |
Gary V. Vaughan |
Subject: |
Re: sysval and doc fixes |
Date: |
Thu, 22 Jun 2006 15:45:37 +0100 |
User-agent: |
Thunderbird 1.5.0.2 (X11/20060519) |
Hallo Ralf!
Ralf Wildenhues wrote:
> Gary V. Vaughan <gary <at> gnu.org> writes:
>> Eric Blake wrote:
>>>>> static int sysval = 0;
>>> That's redundant. Uninitialized static variables live in .bss and are
>>> 0-initialized by the C runtime (it is only the heap and uninitialized
>>> local variables that have garbage values).
>> That is implementation defined IMHO.
>
> No. This has nothing to do with ELF section, but is required by C.
> C89, 3.1.2.4:
> | An object declared with external or internal linkage, or with the
> | storage-class specifier static has static storage duration. For such
> | an object, storage is reserved and its stored value is initialized
> | only once, prior to program startup.
>
> and 3.5.7:
> | If an object that has static storage duration is not initialized
> | explicitly, it is initialized implicitly as if every member that has
> | arithmetic type were assigned 0 and every member that has pointer type
> | were assigned a null pointer constant. If an object that has
> | automatic storage duration is not initialized explicitly, its value is
> | indeterminate./65/
Okay, thanks. I didn't know that.
Cheers,
Gary.
--
Gary V. Vaughan ())_. address@hidden,gnu.org}
Research Scientist ( '/ http://blog.azazil.net
GNU Hacker / )= http://trac.azazil.net/projects/libtool
Technical Author `(_~)_ http://sources.redhat.com/autobook
signature.asc
Description: OpenPGP digital signature