This is similar to C++03,

ISO/IEC 14882-2003 Section 8.5 Initializers
"... if no initializer is specified for a nonstatic object, the object
and its subobjects, if any, have an indeterminate initial value"


T


-----Original Message-----
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul
Melis
Sent: 13 July 2009 12:53
To: OpenSceneGraph Users
Subject: Re: [osg-users] ffmpeg stdint on Windows?

Garrett Potts wrote:
> [...]
> Honestly I have not read up on the C standard and only took what they 
> said as being true.  They said they adhere to the C99 standard and 
> they sent me a cut and past from the C99 standard that said variables 
> are to be initialized to 0 but honestly can't remember if that is for 
> static or non static or both. 
Looks like only static variables are zero-initialized:

ISO/IEC 9899:TC2 draft, section 6.7.8, item 10:
"""
10 If an object that has automatic storage duration is not initialized 
explicitly, its value is
indeterminate. If an object that has static storage duration is not 
initialized explicitly,
then:
- if it has pointer type, it is initialized to a null pointer;
- if it has arithmetic type, it is initialized to (positive or unsigned)

zero;
- if it is an aggregate, every member is initialized (recursively) 
according to these rules;
- if it is a union, the first named member is initialized (recursively) 
according to these
rules.
"""

Paul
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to