a global struct is filled up with NULL/0's while a local struct is not
initialized at all. The patch simply provides more correct code and even
That's not what I read in C standard - it says that if struct is
partially initialized, the rest is zeroed out:
Quoting http://c0x.coding-guidelines.com/6.7.8.html:
1671 If there are fewer initializers in a brace-enclosed list than there
are elements or members of an aggregate, or fewer characters in a string
literal used to initialize an array of known size than there are
elements in the array, the remainder of the aggregate shall be
initialized implicitly the same as objects that have static storage
duration.
1642 If an object that has static storage duration is not initialized
explicitly, then:
1643 — if it has pointer type, it is initialized to a null pointer;
1644 — if it has arithmetic type, it is initialized to (positive or
unsigned) zero;
1645 — if it is an aggregate, every member is initialized (recursively)
according to these rules;
1646 — if it is a union, the first named member is initialized
(recursively) according to these rule
All compilers I know do behave this way. Do not confuse partial
initialization wiht no initialization at all, of course.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED] http://www.zend.com/
(408)253-8829 MSN: [EMAIL PROTECTED]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php