From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7217 invoked by alias); 25 Apr 2002 14:16:05 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 7173 invoked by uid 71); 25 Apr 2002 14:16:01 -0000 Resent-Date: 25 Apr 2002 14:16:01 -0000 Resent-Message-ID: <20020425141601.7169.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Deborah Schindall Received:(qmail 3629 invoked from network); 25 Apr 2002 14:08:00 -0000 Received: from unknown (HELO BOCAMAIL01.adirtech.com) (208.26.1.253) by sources.redhat.com with SMTP; 25 Apr 2002 14:08:00 -0000 Received: by nspkhq1.adirtech.com with Internet Mail Service (5.5.2655.55) id ; Thu, 25 Apr 2002 10:12:43 -0400 Message-Id:<2DFDF912AC637149AE07164132261A571E4AEE@nspkhq1.adirtech.com> Date: Thu, 25 Apr 2002 07:16:00 -0000 From: Deborah Schindall To: gcc-gnats@gcc.gnu.org Subject: c++/6450: Bad output from iostream using hex format with insertion operato r (<<) X-SW-Source: 2002-04/txt/msg01328.txt.bz2 List-Id: >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 #include 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.