Bug 7804 - bad printing of fp constant in warning message
Summary: bad printing of fp constant in warning message
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3
: P3 normal
Target Milestone: 3.3
Assignee: Kriang Lerdsuwanakij
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2002-09-01 20:56 UTC by Richard Henderson
Modified: 2004-11-06 16:00 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Henderson 2002-09-01 20:56:01 UTC
z.cc:5: warning: division by zero in `
   0x00000000000000000080ff3f0000000000000000 / 0.'
z.cc:6: warning: division by zero in `
   0000000000000000000000000000000000000000 / 0.'

Release:
3.2 and 3.3

Environment:
i686-linux

How-To-Repeat:
        extern "C" int printf(const char *, ...);

        struct S
        {
          static const float inf = 1.0f / 0.0f;
          static const float nan = 0.0f / 0.0f;
        };

        int main()
        {
          printf("%f\n%f\n", S::inf, S::nan);
          return 0;
        }
Comment 1 Kriang Lerdsuwanakij 2002-10-04 10:34:16 UTC
Responsible-Changed-From-To: unassigned->lerdsuwa
Responsible-Changed-Why: Patch submitted.
Comment 2 Kriang Lerdsuwanakij 2002-10-04 10:34:16 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed.
Comment 3 Kriang Lerdsuwanakij 2002-10-05 05:33:18 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed
Comment 4 Kriang Lerdsuwanakij 2002-10-05 12:28:16 UTC
From: lerdsuwa@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/7804
Date: 5 Oct 2002 12:28:16 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	lerdsuwa@gcc.gnu.org	2002-10-05 05:28:16
 
 Modified files:
 	gcc/cp         : ChangeLog error.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/other: warning1.C 
 
 Log message:
 	PR c++/7804
 	* error.c (dump_expr) [REAL_CST]: Output in decimal format.
 	
 	* g++.dg/other/warning1.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.2982&r2=1.2983
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/error.c.diff?cvsroot=gcc&r1=1.187&r2=1.188
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2120&r2=1.2121
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/warning1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1