This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: 27_io/istream_extractor_arith.cc fixup
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: libstdc++ at gcc dot gnu dot org
- Date: Wed, 30 Jan 2002 00:46:07 +0100
- Subject: Re: 27_io/istream_extractor_arith.cc fixup
- References: <200201291947.g0TJlR302024@fillmore.constant.com>
Benjamin Kosnik wrote:
> Hey can this patch:
>
> 2002-01-28 Paolo Carlini <pcarlini@unitus.it>
>
> * testsuite/27_io/ostream_inserter_arith.cc (test03):
> Fix to deal correctly with both 32 bit and 64 bit architectures
>
> Be extended to
>
> 27_io/istream_extractor_arith.cc fixup
>
> To fix the fail shown here:
>
> http://gcc.gnu.org/ml/gcc-testresults/2002-01/msg00576.html
> http://gcc.gnu.org/ml/gcc-testresults/2002-01/msg00582.html
> http://gcc.gnu.org/ml/gcc-testresults/2002-01/msg00509.html
>
> ?
I will see, by the way, I have ready (tested i686-pc-linux-gnu, at least) an
improvement of the original patch for ostream_inserter_arith.cc, suggested by
Richard Henderson, attached below (it gets rid the test of the implicit
assumption that CHAR_BIT == 8).
What *really* puzzles me is this:
http://gcc.gnu.org/ml/gcc-testresults/2002-01/msg00582.html
How possibly, ostream_inserter_arith.cc can fail now on ia64? It did'nt fail
before enabling test03, then Andreas tested positively the patch above, and then
it fails now?!?
Andreas, could you please provide some details from libstdc++-v3.log ???
Cheers,
Paolo.
/////////////
diff -urN libstdc++-v3-orig/testsuite/27_io/ostream_inserter_arith.cc
libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
--- libstdc++-v3-orig/testsuite/27_io/ostream_inserter_arith.cc Mon Jan 28
20:04:34 2002
+++ libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc Tue Jan 29 13:17:35
2002
@@ -312,26 +312,26 @@
ostream o(&strbuf);
o << oct << s << ' ' << hex << s;
- if (sizeof(short) == 2)
+ if (numeric_limits<short>::digits + 1 == 16)
VERIFY( strbuf.str() == "177777 ffff" );
- else // sizeof(short) == 4
+ else
VERIFY( strbuf.str() == "37777777777 ffffffff" );
strbuf.str(str_blank);
o << oct << i << ' ' << hex << i;
- if (sizeof(int) == 2)
+ if (numeric_limits<int>::digits + 1 == 16)
VERIFY( strbuf.str() == "177777 ffff" );
- else if (sizeof(int) == 4)
+ else if (numeric_limits<int>::digits + 1 == 32)
VERIFY( strbuf.str() == "37777777777 ffffffff" );
- else // sizeof(int) == 8
+ else
VERIFY( strbuf.str() == "1777777777777777777777 "
"ffffffffffffffff" );
strbuf.str(str_blank);
o << oct << l << ' ' << hex << l;
- if (sizeof(long) == 4)
+ if (numeric_limits<long>::digits + 1 == 32)
VERIFY( strbuf.str() == "37777777777 ffffffff" );
- else // sizeof(long) == 8
+ else
VERIFY( strbuf.str() == "1777777777777777777777 "
"ffffffffffffffff" );
strbuf.str(str_blank);