How EGCS with multi-threaded compliance?
Mike Stump
mrs@wrs.com
Thu Apr 16 18:39:00 GMT 1998
> Date: Wed, 15 Apr 1998 12:36:17 -0400
> From: David Lucas <dlucas@checkfree.com>
> Alexandre Oliva wrote:
> >Nope, because zero-initialization takes place before any dynamic
> >initialization.
> First off, I prefer Unix over any other OS. Secondly, my comments
> earlier where in general, compilers do not implement the same nor
> guarentee order of initialization.
General statements aren't very useful, in general. (:-))
There are hard guarantees abort init order in C++, not many of them,
but there are some.
> Thirdly, where in the C++ specs do you read that zero-initialization
> takes place on anything other than simple types?
3.6.2 Initialization of non-local objects [basic.start.init]
1 The storage for objects with static storage duration (3.7.1) shall be
zero-initialized (8.5) before any other initialization takes place.
5 To zero-initialize storage for an object of type T means:
- if T is a non-union class type, the storage for each nonstatic data
member and each base-class subobject is zero-initialized;
- if T is a union type, the storage for its first data member85) is
zero-initialized;
- if T is an array type, the storage for each element is zero-
initialized;
- if T is a reference type, no initialization is performed.
As you can see, pretty clearly states that non-simple types are in
fact zero-initialized.
More information about the Gcc
mailing list