https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85995

--- Comment #5 from joseph at codesourcery dot com <joseph at codesourcery dot 
com> ---
On Fri, 1 Jun 2018, vincent-gcc at vinc17 dot net wrote:

>      Programmers normally use conditionals on '__STDC__' to ask whether
>      it is safe to use certain features of ISO C, such as function
>      prototypes or ISO token concatenation.
> 
> Precisely this is what I wish to do, with 2 versions of a macro: one that
> assumes C conformance (requiring -fexcess-precision=standard with GCC, in
> particular), and another one that doesn't but may be slower.

The typical features people want to test are ones for which __STDC__ gives 
the correct answer.  Likewise if they use __STDC_VERSION__ with a view to 
testing for support for VLAs or compound literals, for example.

You can test for a conformance mode by testing __STRICT_ANSI__ (though 
someone can still use -f options affecting conformance together with a 
-std option that enables a conformance mode).  You can also test 
__GCC_IEC_559 > 0 if you wish to test that no options have been used that 
specifically disable IEEE 754 floating-point features and that 
floating-point exceptions and rounding modes are supported as far as GCC 
knows (the precise rules for __GCC_IEC_559 depend on whether an option 
such as -std=c11 is used as well).

Reply via email to