This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]