solaris iostream long long support

Peter A. Bigot pabigot@qwest.net
Wed Sep 26 19:08:00 GMT 2001


libstdc++-v3 configure silently turns off --enable-long-long if full c99
support is not present, even if strtoll and strtoul are available.  On
Solaris7 and Solaris8, there is something missing (I think in the math
library) that disables C99, thereby also disabling long-long even though all
that's needed for that is strto{u,}ll, both of which are available.

In this situation, g++ -v still indicates that long-long is enabled, but
libstdc++-v3/config.h does not define _GLIBCPP_USE_LONG_LONG, and any
attempt to use iostream operators on long long data objects fails to
compile.  This change happened late in the 3.0 pre-release series, and is
still present in 3.0.1; long long iostream support still worked in at least
one of the April or May pre-releases.

There's a message from 22Jun2001 to this list describing this same problem,
but I haven't seen any follow-ups.  Any chance of a fix for this making it
in to 3.0.2?

Peter

moray[47]$ /usr/local/gcc-3.0.1/bin/g++ -v
Reading specs from /usr/local/gcc-3.0.1/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/specs
Configured with: ../configure --prefix=/usr/local/gcc-3.0.1 --enable-long-long --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.0.1
moray[48]$ cat hello.cc
#include <iostream.h>

int main (void)
{
  long long int i = 3;
  cout << "Hi there number " << i << endl;
}
moray[49]$ /usr/local/gcc-3.0.1/bin/g++ hello.cc
hello.cc: In function `int main()':
hello.cc:6: ambiguous overload for `std::basic_ostream<char,
   std::char_traits<char> >& << long long int&' operator
/usr/local/gcc-3.0.1/include/g++-v3/bits/ostream.tcc:140: candidates are:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(long int) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/ostream.tcc:177:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(long unsigned int) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/ostream.tcc:115:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(bool) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/std_ostream.h:99:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(short int) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/std_ostream.h:110:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(short unsigned int) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/std_ostream.h:114:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(int) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/std_ostream.h:125:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(unsigned int) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/ostream.tcc:267:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(double) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/std_ostream.h:140:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(float) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/ostream.tcc:292:
   std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
   _Traits>::operator<<(long double) [with _CharT = char, _Traits =
   std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/std_ostream.h:231:
   std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char,
   _Traits>&, unsigned char) [with _Traits = std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/std_ostream.h:226:
   std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char,
   _Traits>&, signed char) [with _Traits = std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/ostream.tcc:575:
   std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char,
   _Traits>&, char) [with _Traits = std::char_traits<char>]
/usr/local/gcc-3.0.1/include/g++-v3/bits/std_ostream.h:215:
   std::basic_ostream<_CharT, _Traits>&
   std::operator<<(std::basic_ostream<_CharT, _Traits>&, char) [with _CharT =
   char, _Traits = std::char_traits<char>]
moray[50]$ uname -a
SunOS moray 5.8 Generic_108528-05 sun4u sparc SUNW,Ultra-4



More information about the Libstdc++ mailing list