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.
*** This bug has been marked as a duplicate of 11931 ***
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).