C++ constructors

João Cadamuro Junior cadamuro@lit.cpdtt.cefetpr.br
Wed May 16 12:06:00 GMT 2001


Hello,

I have worked with GCC and G++ for "powerpc-eabi" embedded targets. In
the last two versions of GCC (2.95.2 and 2.95.3) I have learned some
hard things about C++ constructor and GCC.

Under gcc-2.95.2 the execution order of constructors is the linkage
order. The first file linked will construct their objects first.

Under gcc-2.95.3, the behavior is the opposite. The last linked archive
will construct their objects first.

Since I want to have a c++ code to be compiled correctly independent of
the compiler version, someone knows what can I do to force some order to
constructors under G++?


Thanks in advance,

João Cadamuro Junior
LIT / CPDTT / CEFET-PR


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com



More information about the crossgcc mailing list