This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
static object constructor bug.
- To: "'egcs-bugs at cygnus dot com'" <egcs-bugs at cygnus dot com>
- Subject: static object constructor bug.
- From: Paul Kendall <paul at orion dot co dot nz>
- Date: Thu, 20 Nov 1997 16:14:27 +1300
Hi, heres a really obscure bug to do with static object constructors.
I am using an sgi-irix5.3 system. This bug appears in gcc-2.7.2.1
and egcs-971114.
I assume that this will occur for other systems. I don't really have
one to try it on.
class B {
public:
B() {}
~B() {}
};
class A {
public:
A();
~A();
protected:
static B b;
};
B A::b;
A::A() {
}
A::~A() {
}
nm -B t.o | grep GLOB
000000b8 T _GLOBAL_$D$_1A$b
00000001 D _GLOBAL_$F$_1A$b
0000011c T _GLOBAL_$I$_1A$b
when B A::b; moved after A::A()
nm -B t.o | grep GLOB
000000b8 T _GLOBAL_$D$__1A
00000001 D _GLOBAL_$F$__1A
0000011c T _GLOBAL_$I$__1A
Cheers,
Paul Kendall
Product Development Manager
Orion Systems New Zealand Ltd