public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/23139] New: -pedantic -ffast-math breaks working code
@ 2005-07-29 21:01 thor at math dot tu-berlin dot de
  2005-07-29 21:14 ` [Bug c++/23139] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: thor at math dot tu-berlin dot de @ 2005-07-29 21:01 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-09-27 16:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-29 21:01 [Bug c++/23139] New: -pedantic -ffast-math breaks working code thor at math dot tu-berlin dot de
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

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