public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "thor at math dot tu-berlin dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/23139] New: -pedantic -ffast-math breaks working code
Date: Fri, 29 Jul 2005 21:01:00 -0000	[thread overview]
Message-ID: <20050729205340.23139.thor@math.tu-berlin.de> (raw)

Using the command line switches -pedantic -ffast-math triggers an error and
aborts compilation of code using HUGE_VAL.

To reproduce, save the following code as huge.cpp:

#include <math.h>
#include <stdio.h>

int main(int argc,char **argv)
{
  double v = HUGE_VAL;

  printf("%f\n",v);

  return 0;
}

Compile with:

g++-4.0 -ffast-math -pedantic huge.cpp

Result is:
huge.cpp:6:14: warning: use of C99 hexadecimal floating constant
huge.cpp:6: error: floating constant exceeds range of 'double'

Compilation aborts here. Note that there is a similar bug in the database,
namely #11931 that exists at least since g++-3.3.2 and has not been touched
yet. Unfortunately, starting with g++-4.0.1, this bug causes an unjustified
error (not just a warning) and thus avoids compilation of existing
production code. Bug #11931 has been marked as priority "low"; however,
since this bug remained in the bug data base for so long now, and since it
is now even raised to an error instead of just a warning, I would like to
suggest to raise the priority to "normal".

And please, please: Could please someone care about this one?

So long, and thanks a lot,
Thomas

-- 
           Summary: -pedantic -ffast-math breaks working code
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: thor at math dot tu-berlin dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23139


             reply	other threads:[~2005-07-29 20:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-29 21:01 thor at math dot tu-berlin dot de [this message]
2005-07-29 21:14 ` [Bug c++/23139] " pinskia at gcc dot gnu dot org
2005-07-29 21:18 ` thor at math dot tu-berlin dot de
2005-07-29 21:19 ` pinskia at gcc dot gnu dot org
2005-07-29 21:59 ` thor at math dot tu-berlin dot de
2005-07-30 15:39 ` [Bug c++/23139] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-09-06 15:29 ` mmitchel at gcc dot gnu dot org
2005-09-06 16:12   ` Gabriel Dos Reis
2005-09-06 15:43 ` joseph at codesourcery dot com
2005-09-06 16:12 ` gdr at integrable-solutions dot net
2005-09-06 22:03 ` mmitchel at gcc dot gnu dot org
2005-09-15 19:11 ` cvs-commit at gcc dot gnu dot org
2005-09-15 19:13 ` cvs-commit at gcc dot gnu dot org
2005-09-27 16:25 ` mmitchel at gcc dot gnu dot org

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=20050729205340.23139.thor@math.tu-berlin.de \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).