Add release notes for new C2X features in GCC 11

Joseph Myers joseph@codesourcery.com
Fri Feb 5 21:58:15 GMT 2021


Binary constants aren't mentioned individually in this list because
they are covered by the general wording about features previously
supported as extensions.  Allowing duplicate standard attributes isn't
mentioned as it's considered a minor change of details of a feature
supported in GCC 10, rather than a new feature.

Committed.

diff --git a/htdocs/gcc-11/changes.html b/htdocs/gcc-11/changes.html
index a8b036c3..ba8180e8 100644
--- a/htdocs/gcc-11/changes.html
+++ b/htdocs/gcc-11/changes.html
@@ -232,6 +232,47 @@ a work-in-progress.</p>
       and <code>-j</code> to <code>-H</code>.</li>
 </ul>
 
+<h3 id="c">C</h3>
+<ul>
+  <li>Several new features from the upcoming C2X revision of the ISO C
+  standard are supported with <code>-std=c2x</code>
+  and <code>-std=gnu2x</code>.  Some of these features are also
+  supported as extensions when compiling for older language versions.
+  In addition to the features listed, some features previously
+  supported as extensions and now added to the C standard are enabled
+  by default in C2X mode and not diagnosed with <code>-std=c2x
+  -Wpedantic</code>.
+  <ul>
+    <li>The <code>BOOL_MAX</code> and <code>BOOL_WIDTH</code> macros
+    are provided in <code><limits.h></code>.</li>
+    <li>As in C++, function definitions no longer need to give names
+    for unused function parameters.</li>
+    <li>The expansions of the <code>true</code> and <code>false</code>
+    macros in <code><stdbool.h></code> have changed so that they
+    have type <code>bool</code>.</li>
+    <li>The <code>[[nodiscard]]</code> standard attribute is now
+    supported.</li>
+    <li>The <code>__has_c_attribute</code> preprocessor operator is
+    now supported.</li>
+    <li>Macros <code>INFINITY</code>, <code>NAN</code>, <code>FLT_SNAN</code>,
+    <code>DBL_SNAN</code>, <code>LDBL_SNAN</code>, <code>DEC_INFINITY</code>,
+    <code>DEC_NAN</code>, and corresponding signaling NaN macros for
+    <code>_Float<i>N</i></code>, <code>_Float<i>N</i>x</code>
+    and <code>_Decimal<i>N</i></code> types, are provided
+    in <code><float.h></code>.  There are also corresponding
+    built-in functions <code>__builtin_nansd<i>N</i></code> for
+    decimal signaling NaNs.</li>
+    <li>Macros <code>FLT_IS_IEC_60559</code>, <code>DBL_IS_IEC_60559</code>
+    and <code>LDBL_IS_IEC_60559</code> are provided
+    in <code><float.h></code>.</li>
+    <li>The feature test
+    macro <code>__STDC_WANT_IEC_60559_EXT__</code> is supported
+    by <code><float.h></code>.</li>
+    <li>Labels may appear before declarations and at the end of a
+    compound statement.</li>
+  </ul></li>
+</ul>
+
 <h3 id="cxx">C++</h3>
 <ul>
   <li>The default mode has been changed to <code>-std=gnu++17</code>.</li>

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Gcc-patches mailing list