Static initialisation question...

Mike Harrold mharrold@cas.org
Wed Apr 25 11:55:00 GMT 2001


> 
> On Apr 24, 2001, Mike Harrold <mharrold@cas.org> wrote:
> 
> >> 
> >> On Apr 24, 2001, Mike Harrold <mharrold@cas.org> wrote:
> >> 
> >> > My qeustion is if it is safe to assume that static member objects of
> >> > a base class are always initialised before statis member objects of
> >> > a derived class?
> >> 
> >> Is this a question about C++ the language (in which this is the wrong
> >> forum) or about the g++ implementation on a certain platform (in which
> >> case I don't know the answer anyway)?
> 
> > It's a question about the g++ implementation.
> 
> Still, you failed to mention which platform your question applies to.
> The answer may well change from platform to platform, since it's quite
> dependent on properties of the run-time loader.  Even more so if you
> thrown shared libraries and dlopened modules into the picture.

I'm on Linux, but the more I think about it, the more I realise that
because of the dlopen() conundrum, you can't guarantee anything, right?

/Mike



More information about the Gcc-help mailing list