This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: V3 static data in classes vs AIX
- To: Gabriel Dos Reis <gdr at codesourcery dot com>
- Subject: Re: V3 static data in classes vs AIX
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Mon, 04 Jun 2001 13:56:41 -0400
- cc: Benjamin Kosnik <bkoz at redhat dot com>, libstdc++ at gcc dot gnu dot org, Mark Mitchell <mark at codesourcery dot com>
>>>>> Gabriel Dos Reis writes:
Gabriel> Excuse my naivety, but is there any reason it -should- produce the
Gabriel> common symbol?
No, it should not.
The problem is that various testsuite cases *are* producing common
symbols which is a duplicate definition of the variable.
So far my testcase is down to
#include <string>
#include <sstream>
std::string
test01()
{
std::ostringstream os0;
std::string str03 = os0.str();
return str03;
}
int main()
{
test01();
return 0;
}
which produces warnings like:
ld: 0711-224 WARNING: Duplicate symbol: std::string::_S_empty_rep_storage
ld: 0711-224 WARNING: Duplicate symbol: std::num_get<char, std::istreambuf_iterator<char, std::char_traits<char> > >::id
ld: 0711-224 WARNING: Duplicate symbol: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::id
Something is wrong with the V3 headers (or with the G++ compiler)
that including the headers generates definitions of those static class
members instead of just references, as my simple example produces.
Thanks, David