Hi, The attached source makes use of the "long long" type which is defined by the compiler. Unfortunately there's no specialization of stream input and output operators for "long long": $ cat > foo.cc #include <iostream> using namespace std; int main() { long long i; cout << i << endl; } $ $ g++ foo.cc foo.cc: In function `int main()': foo.cc:5: error: ambiguous overload for 'operator<<' in 'std::cout << i' /usr/local/include/c++/3.3.4/bits/ostream.tcc:63: error: candidates are: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>&(*)(std::basic_ostream<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits<char>] <near match> /usr/local/include/c++/3.3.4/bits/ostream.tcc:74: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ios<_CharT, _Traits>&(*)(std::basic_ios<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits<char>] <near match> /usr/local/include/c++/3.3.4/bits/ostream.tcc:86: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base&(*)(std::ios_base&)) [with _CharT = char, _Traits = std::char_traits<char>] <near match> /usr/local/include/c++/3.3.4/bits/ostream.tcc:122: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char, _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/bits/ostream.tcc:156: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char, _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/bits/ostream.tcc:98: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char, _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/ostream:178: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char, _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/ostream:189: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char, _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/ostream:193: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char, _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/ostream:204: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char, _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/bits/ostream.tcc:241: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char, _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/ostream:219: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char, _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/bits/ostream.tcc:265: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char, _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/bits/ostream.tcc:289: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char, _Traits = std::char_traits<char>] <near match> /usr/local/include/c++/3.3.4/bits/ostream.tcc:313: error: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_streambuf<_CharT, _Traits>*) [with _CharT = char, _Traits = std::char_traits<char>] <near match> /usr/local/include/c++/3.3.4/ostream:436: error: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char) [with _CharT = char, _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/bits/ostream.tcc:512: error: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char) [with _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/ostream:447: error: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char) [with _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/ostream:452: error: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char) [with _Traits = std::char_traits<char>] /usr/local/include/c++/3.3.4/bits/ostream.tcc:572: error: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*) [with _CharT = char, _Traits = std::char_traits<char>] <near match> /usr/local/include/c++/3.3.4/bits/ostream.tcc:616: error: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*) [with _Traits = std::char_traits<char>] <near match> /usr/local/include/c++/3.3.4/ostream:486: error: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const signed char*) [with _Traits = std::char_traits<char>] <near match> /usr/local/include/c++/3.3.4/ostream:491: error: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const unsigned char*) [with _Traits = std::char_traits<char>] <near match> $ That's because in header files <istream> and <ostream> the relevant functions are protected by _GLIBCPP_USE_LONG_LONG: #ifdef _GLIBCPP_USE_LONG_LONG __istream_type& operator>>(long long& __n); __istream_type& operator>>(unsigned long long& __n); #endif and: #ifdef _GLIBCPP_USE_LONG_LONG __ostream_type& operator<<(long long __n); __ostream_type& operator<<(unsigned long long __n); #endif Why is _GLIBCPP_USE_LONG_LONG not defined on Tru64? Type "long long" is legal and distinct from "long". SHouldn't it be defined?
Created attachment 6865 [details] compile/link this file on Tru64 to reproduce the bug
PR libstdc++/16210 is related to this one, but not identical: for gcc3.4.x we have been able to remove completely the autoconf test for _GLIBCPP_USE_LONG_LONG since no libc functions are used anymore to support I/O of long long types. On the other hand, if long long support ends up being disabled on Tru64 with gcc3.3.x, it's because the required strto(u)ll functions are not available there: we can't do much about this, unfortunately. Can you confirm the latter analysis?
I can confirm strto(u)ll are not available on Tru64. However that's not a problem since you can use strto(u)l instead. Remember, Tru64 is a 64-bit system (64-bit *only* as opposed to other systems that used to be 32-bit, have moved to 64-bit, and run both 32-bit and 64-bit programs).
I see... I hope you will understand that at this point in time, it would be too much work taking care of this special case in the 3.3.x branch. Sorry. Could you possibly hack locally your tree? I'm attaching a draft patch.
Created attachment 6866 [details] Local hack
Created attachment 6867 [details] Amended
Created attachment 6868 [details] Sorry, this one should be complete
I understand, I was just reporting the problem so that it can be fixed in gcc 3.4 or 3.5. Unfortunately I don't have root access on the Tru64 machine to modify the installed GCC compiler, and it would take too much time to build my own version of it - I'm not even certain I have enough space on my home directory. I worked around the problem in my code by typedef'ing to "long" instead of "long long" on Tru64.
Created attachment 6869 [details] Shish, this one it is
By the way, will this be fixed in 3.5, as part of PR libstdc++/16210 or independently of it?
Yes, it's already fixed for 3.5 and 3.4.2.