Bug 22428 - __extension__ won't silence pedwarns about hex float constants
Summary: __extension__ won't silence pedwarns about hex float constants
Status: RESOLVED DUPLICATE of bug 11931
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-12 05:53 UTC by Ben Elliston
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
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 Ben Elliston 2005-07-12 05:53:10 UTC
The __extension__ keyword does not silence pedwarns about hexadecimal floating
point constants.  This is used by GNU libc, for example in the definition of
INFINITY:

#  define HUGE_VALF (__extension__ 0x1.0p255f)
#  define HUGE_VALL (__extension__ 0x1.0p32767L)

These macros produce warnings that cannot be silenced.  This appears not to work
because the pedwarn is generated by the preprocessor.
Comment 1 Andrew Pinski 2005-07-12 05:56:37 UTC

*** This bug has been marked as a duplicate of 11931 ***
Comment 2 jsm-csl@polyomino.org.uk 2005-07-12 12:04:00 UTC
Subject: Re:  New: __extension__ won't silence pedwarns
 about hex float constants

On Tue, 12 Jul 2005, bje at gcc dot gnu dot org wrote:

> The __extension__ keyword does not silence pedwarns about hexadecimal floating
> point constants.  This is used by GNU libc, for example in the definition of
> INFINITY:
> 
> #  define HUGE_VALF (__extension__ 0x1.0p255f)
> #  define HUGE_VALL (__extension__ 0x1.0p32767L)
> 
> These macros produce warnings that cannot be silenced.  This appears not to work
> because the pedwarn is generated by the preprocessor.

My preference for this (bug 7263 / 11931) would be disabling it for the 
expansion of macros defined in system headers rather than making the 
preprocessor aware of __extension__.

current-ish glibc uses #if __GNUC_PREREQ(3,3)
# define HUGE_VAL       (__builtin_huge_val())

and similar which avoid this problem (but not the corresponding one for 
_Complex_I).