public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Deborah Schindall <dschindall@adirtech.com>
To: gcc-gnats@gcc.gnu.org
Subject: c++/6450: Bad output from iostream using hex format with insertion operato r (<<)
Date: Thu, 25 Apr 2002 07:16:00 -0000	[thread overview]
Message-ID: <2DFDF912AC637149AE07164132261A571E4AEE@nspkhq1.adirtech.com> (raw)


>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.


                 reply	other threads:[~2002-04-25 14:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2DFDF912AC637149AE07164132261A571E4AEE@nspkhq1.adirtech.com \
    --to=dschindall@adirtech.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).