Static initialisation question...

Mike Harrold mharrold@cas.org
Wed Apr 25 05:51:00 GMT 2001


> 
> > 
> > It's a question about the g++ implementation.
> > 
> > /Mike
> > 
> I wouldn't try to use compiler implementation defined rules. G++ is a
> developing project. Such rules can even change from one release to
> another, and you would stress yourself if your program will do something
> different in half a year, when you updated your distribution.

Regardless, I'd still like an answer to the question. The way I see it
(and I don't know if the C++ standard covers this in any way) it would
seem that static objects of a base class must be initialised first as
it just makes common sense. From my own experiments, this appears to be
the case with g++ (although maybe I just got lucky :) ). What I am
interested in is if there is any design scheme for g++ which dictates
that this is either done, not done, or is totally random.

Regards,

/Mike



More information about the Gcc-help mailing list