From: Danny Smith <dannysmith@cl...> - 2007-05-17 21:03:27
Sent: Friday, 18 May 2007 8:20 a.m.
> On 2007-05-17 19:14Z, John Brown wrote:
> > I am doing an exercise, the purpose of which is to show
> that you cannot
> > rely on the order in which global objects are created, when you are
> > initialising an object based on successfully initialising another
> > object. Consider the following class:
> > The question says to include this file in 5 different .cpp
> files, and
> > define some objects like this:
> > The question says "If the result is true, find out how to change the
> > linking order for your linker and change it until the
> result is false."
> AFAIK, the linker follows whatever object ordering it's given, and
> doesn't, say, alphabetize them by file name. But you could try
> changing the file names to find out.
What Greg said.
Also search for attribute init_priority in GCC doc's