Order of initialization of global/static variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
In gcc 4.4.6 we had no problem with the order of initialization.
In gcc 4.7.2 we do have a problem.
A CPP file defined GlobalObj_1 (declared extern in the H file):
CMyClass GlobalObj_1.
Another CPP file declared GlobalObj_2 (also declared extern in the H
file).=  The CPP file used copy constructor:
CMyClass GlobalObj_2(GlobalObj_1).
In 4.4.6 GlobalObj_1 was initialized first. Now GlobalObj_2 is
initialized = first.
Is this intentional?
How do I revert to old behavior?
The problem is that we have many files with many global variables (const).
Thanks,
Yaron.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux