This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/85995] GCC defines __STDC__ and __STDC_VERSION__ even when used with options that break C conformance
- From: "vincent-gcc at vinc17 dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 01 Jun 2018 22:50:22 +0000
- Subject: [Bug c/85995] GCC defines __STDC__ and __STDC_VERSION__ even when used with options that break C conformance
- Auto-submitted: auto-generated
- References: <bug-85995-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85995
--- Comment #4 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
(In reply to joseph@codesourcery.com from comment #3)
> See trouble.texi, "Non-bugs" / "Certain Changes We Don't Want to Make",
> "Undefining @code{__STDC__} when @option{-ansi} is not used."
which answers my request.
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.
Since plain 'gcc' supports all the features of ISO C, the correct
answer to these questions is "yes".
This sentence is wrong by default, as it would imply
-fexcess-precision=standard!