V3 static data in classes vs AIX

David Edelsohn dje@watson.ibm.com
Mon Jun 4 10:57:00 GMT 2001


>>>>> 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



More information about the Libstdc++ mailing list