public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/16854] New: streams missing "long long" specializations on Tru64
@ 2004-08-02 13:21 papadopo at shfj dot cea dot fr
  2004-08-02 13:24 ` [Bug libstdc++/16854] " papadopo at shfj dot cea dot fr
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: papadopo at shfj dot cea dot fr @ 2004-08-02 13:21 UTC (permalink / raw)
  To: gcc-bugs

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?

-- 
           Summary: streams missing "long long" specializations on Tru64
           Product: gcc
           Version: 3.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: papadopo at shfj dot cea dot fr
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16854


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/16854] streams missing "long long" specializations on Tru64
  2004-08-02 13:21 [Bug libstdc++/16854] New: streams missing "long long" specializations on Tru64 papadopo at shfj dot cea dot fr
@ 2004-08-02 13:24 ` papadopo at shfj dot cea dot fr
  2004-08-02 13:40 ` pcarlini at suse dot de
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: papadopo at shfj dot cea dot fr @ 2004-08-02 13:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From papadopo at shfj dot cea dot fr  2004-08-02 13:24 -------
Created an attachment (id=6865)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6865&action=view)
compile/link this file on Tru64 to reproduce the bug


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16854


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/16854] streams missing "long long" specializations on Tru64
  2004-08-02 13:21 [Bug libstdc++/16854] New: streams missing "long long" specializations on Tru64 papadopo at shfj dot cea dot fr
  2004-08-02 13:24 ` [Bug libstdc++/16854] " papadopo at shfj dot cea dot fr
@ 2004-08-02 13:40 ` pcarlini at suse dot de
  2004-08-02 13:55 ` papadopo at shfj dot cea dot fr
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pcarlini at suse dot de @ 2004-08-02 13:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-08-02 13:40 -------
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?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16854


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/16854] streams missing "long long" specializations on Tru64
  2004-08-02 13:21 [Bug libstdc++/16854] New: streams missing "long long" specializations on Tru64 papadopo at shfj dot cea dot fr
  2004-08-02 13:24 ` [Bug libstdc++/16854] " papadopo at shfj dot cea dot fr
  2004-08-02 13:40 ` pcarlini at suse dot de
@ 2004-08-02 13:55 ` papadopo at shfj dot cea dot fr
  2004-08-02 14:07 ` pcarlini at suse dot de
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: papadopo at shfj dot cea dot fr @ 2004-08-02 13:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From papadopo at shfj dot cea dot fr  2004-08-02 13:55 -------
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).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16854


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/16854] streams missing "long long" specializations on Tru64
  2004-08-02 13:21 [Bug libstdc++/16854] New: streams missing "long long" specializations on Tru64 papadopo at shfj dot cea dot fr
                   ` (2 preceding siblings ...)
  2004-08-02 13:55 ` papadopo at shfj dot cea dot fr
@ 2004-08-02 14:07 ` pcarlini at suse dot de
  2004-08-02 14:19 ` papadopo at shfj dot cea dot fr
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pcarlini at suse dot de @ 2004-08-02 14:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-08-02 14:07 -------
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.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16854


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/16854] streams missing "long long" specializations on Tru64
  2004-08-02 13:21 [Bug libstdc++/16854] New: streams missing "long long" specializations on Tru64 papadopo at shfj dot cea dot fr
                   ` (3 preceding siblings ...)
  2004-08-02 14:07 ` pcarlini at suse dot de
@ 2004-08-02 14:19 ` papadopo at shfj dot cea dot fr
  2004-08-02 14:21 ` papadopo at shfj dot cea dot fr
  2004-08-02 14:22 ` pcarlini at suse dot de
  6 siblings, 0 replies; 8+ messages in thread
From: papadopo at shfj dot cea dot fr @ 2004-08-02 14:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From papadopo at shfj dot cea dot fr  2004-08-02 14:19 -------
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.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16854


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/16854] streams missing "long long" specializations on Tru64
  2004-08-02 13:21 [Bug libstdc++/16854] New: streams missing "long long" specializations on Tru64 papadopo at shfj dot cea dot fr
                   ` (4 preceding siblings ...)
  2004-08-02 14:19 ` papadopo at shfj dot cea dot fr
@ 2004-08-02 14:21 ` papadopo at shfj dot cea dot fr
  2004-08-02 14:22 ` pcarlini at suse dot de
  6 siblings, 0 replies; 8+ messages in thread
From: papadopo at shfj dot cea dot fr @ 2004-08-02 14:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From papadopo at shfj dot cea dot fr  2004-08-02 14:21 -------
By the way, will this be fixed in 3.5, as part of PR libstdc++/16210 or
independently of it?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16854


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/16854] streams missing "long long" specializations on Tru64
  2004-08-02 13:21 [Bug libstdc++/16854] New: streams missing "long long" specializations on Tru64 papadopo at shfj dot cea dot fr
                   ` (5 preceding siblings ...)
  2004-08-02 14:21 ` papadopo at shfj dot cea dot fr
@ 2004-08-02 14:22 ` pcarlini at suse dot de
  6 siblings, 0 replies; 8+ messages in thread
From: pcarlini at suse dot de @ 2004-08-02 14:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-08-02 14:22 -------
Yes, it's already fixed for 3.5 and 3.4.2.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16854


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-08-02 14:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-02 13:21 [Bug libstdc++/16854] New: streams missing "long long" specializations on Tru64 papadopo at shfj dot cea dot fr
2004-08-02 13:24 ` [Bug libstdc++/16854] " papadopo at shfj dot cea dot fr
2004-08-02 13:40 ` pcarlini at suse dot de
2004-08-02 13:55 ` papadopo at shfj dot cea dot fr
2004-08-02 14:07 ` pcarlini at suse dot de
2004-08-02 14:19 ` papadopo at shfj dot cea dot fr
2004-08-02 14:21 ` papadopo at shfj dot cea dot fr
2004-08-02 14:22 ` pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).