This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/11931] New: unjustified warning for C89 code using HUGE_VAL


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: unjustified warning for C89 code using HUGE_VAL
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org
                CC: gcc-bugs at gcc dot gnu dot org

[forwarded from http://bugs.debian.org/201658]

Consider the following .c file:

    #include <math.h>
    double x = HUGE_VAL;

gcc -ansi -pedantic -Wall gives the warning "use of C99 hexadecimal
floating constant".  There is nothing remotely suspicious about the
code that would deserve a warning; it is entirely C89 conformant.
Presumably math.h (or something included by it) needs a tweak in its #if
directives.

There might be other symbolic constants with the same problem; I haven't
searched for them.

Matt Zimmerman writes:
> On Thu, Jul 17, 2003 at 02:21:02AM +0000, Adam M. Costello wrote:
>
> > There is nothing remotely suspicious about the code that would deserve a
> > warning; it is entirely C89 conformant.  Presumably math.h (or something
> > included by it) needs a tweak in its #if directives.
> >
> > There might be other symbolic constants with the same problem; I haven't
> > searched for them.
>
> My copy of bits/huge_val.h does this:
>
> #if __GNUC_PREREQ(2,96)
> # define HUGE_VAL       (__extension__ 0x1.0p2047)
> #else
> [...]
>
> That code is not c89, but legal in gcc, and the warning would be legitimate,
> except that I think __extension__ should be suppressing it.

Adam M. Costello writes:
> Matt Zimmerman <mdz@debian.org> wrote:
> > I think __extension__ should be suppressing [the warning].
>
> Maybe that's the bug; __extension__ is not having its intended effect.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]