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
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org