This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3] testsuite fixes
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 22 Feb 2002 10:12:05 -0800 (PST)
- Subject: Re: [v3] testsuite fixes
> Sorry for all those troublesome "static" keywords: I have dumbly copied them from a PR
> without really understanding the implications.
No worries.
> Could you possibly explain to me briefly why they are problematic for AIX??
I can try. I've always thought the "Vague Linkage" section of the gcc
manual was a bit weak on specifics. This would probably be a good example
to put in, for local statics:
http://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html
If you look at the compiler output in this message:
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00189.html
It appears as if pat is defined, no weak, in every translation unit.
On linux, and other systems, the following code:
class bar
{
public:
int foo() const
{
static int pat = 6;
return pat;
}
};
int main()
{
bar obj;
obj.foo();
return 0;
}
Gives:
00000000 W bar::foo() const
00000000 V bar::foo()::pat const
U __gxx_personality_v0
00000000 T main
So pat is a weak object (man nm has more info). On aix, it's T, not V.
-benjamin