This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: [PATCH] Fix _M_extract_int for grouped hexs and octs


Benjamin Kosnik wrote:

> > I took also the occasion to remove 3 more static keywords lurking around.
>
> Excellent.
>
> > Is it ok for head, and, after some more testing, 3.1 ??
>
> Yep. I think the 3_1 branch is caught up to mainline now, so you can move
> this over immediately if you'd like.

Thanks. I think I will wait for some testresults (64 bit too) and then I will move
today's and yesterday's patches to the branch.

Anyway, I'm still trying to learn more of the difficult (for me) "AIX" issue. In
fact it looks like a static string is *different* from a static int. Modifying your
testcase as follows:

#include <string>

class bar
{
public:
  std::string foo() const
  {
    static std::string pat = "Paolo";
    return pat;
  }
};

int main()
{
  bar obj;
  obj.foo();
  return 0;
}

this is what nm gives me:

         U _Unwind_Resume
00000008 C guard variable for bar::foo()::pat const
00000000 W bar::foo() const
00000000 W std::allocator<char>::allocator()
00000000 W std::allocator<char>::~allocator()
         U std::string::string(char const*, std::allocator<char> const&)
         U std::string::string(std::string const&)
         U std::string::~string()
00000000 V std::_Swap_lock_struct<0>::_S_swap_lock
00000004 C bar::foo()::pat const
         U __gxx_personality_v0
00000038 t __tcf_0
         U atexit
00000000 T main

Whereas, removing the static keyword:

         U _Unwind_Resume
00000000 W bar::foo() const
00000000 W std::allocator<char>::allocator()
00000000 W std::allocator<char>::~allocator()
         U std::string::string(char const*, std::allocator<char> const&)
         U std::string::~string()
00000000 V std::_Swap_lock_struct<0>::_S_swap_lock
         U __gxx_personality_v0
00000000 T main

Therefore, I would guess static strings are not really troublesome for AIX. Have you
got a simple explanation for this??

Ciao,
Paolo.



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