public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/6450: Bad output from iostream using hex format with insertion operato r (<<)
@ 2002-04-25 7:16 Deborah Schindall
0 siblings, 0 replies; only message in thread
From: Deborah Schindall @ 2002-04-25 7:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 6450
>Category: c++
>Synopsis: Using hex directive with insertion operator (<<) does not
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Apr 25 07:16:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Deborah Schindall
>Release: 3.0.4
>Organization:
Adir Technologies, Inc.
>Environment:
System: SunOS sundevshared.engineering.netspeak.com 5.8 Generic_108528-13
sun4u sparc SUNW,Ultra-4
Architecture: sun4
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../gcc-3.0.4/configure --enable-threads=posix
--with-as=/vobs/OEM/gnu/binutils/2.11.2/bin/as
--with-ld=/vobs/OEM/gnu/binutils/2.11.2/bin/ld
--prefix=/vobs/OEM/gnu/gcc/3.0.4 --exec-prefix=/vobs/OEM/gnu/gcc/3.0.4
>Description:
Using fstream or iostream for output to file or standardo out, the directive
"hex" should display the output as a hex number, but actually displays as
some floating point junk. This code works as expected with the 3.0.2
compiler.
>How-To-Repeat:
#include <iostream>
#include <fstream>
using namespace std;
main()
{
long i = 100;
ofstream des;
des.open("/tmp/des.out.txt");
des << hex << i << endl;
des << dec << i << endl;
cout << hex << i << endl;
cout << dec << i << endl;
}
Expect this code to print out "64" and then "100". But actually outputs
"2.14315e-312" and "100".
I have collected information available.
>Fix:
not known, Need a workaround or patch.
>Release-Note:
>Audit-Trail:
>Unformatted:
work correctly.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-04-25 14:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-25 7:16 c++/6450: Bad output from iostream using hex format with insertion operato r (<<) Deborah Schindall
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).