llvm-project/clang/www/c_status.html

533 lines
21 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Clang - C Programming Language Status</title>
<link type="text/css" rel="stylesheet" href="menu.css">
<link type="text/css" rel="stylesheet" href="content.css">
<style type="text/css">
.none { background-color: #FFCCCC }
.partial { background-color: #FFE0B0 }
.unreleased { background-color: #FFFF99 }
.unknown { background-color: #FF55FF }
.full { background-color: #CCFF99 }
.na { background-color: #DDDDDD }
:target { background-color: #FFFFBB; outline: #DDDD55 solid thin; }
th { background-color: #FFDDAA }
td { vertical-align: middle }
tt { white-space: nowrap }
</style>
</head>
<body>
<!--#include virtual="menu.html.incl"-->
<div id="content">
<!--*************************************************************************-->
<h1>C Support in Clang</h1>
<!--*************************************************************************-->
<p>Clang implements the following published and upcoming ISO C standards:</p>
<table width="689" border="1" cellspacing="0">
<tr>
<th>Language Standard</th>
<th>Flag</th>
<th>Available in Clang?</th>
</tr>
<tr>
<td><a href="#c89">C89</a></td>
<td><tt>-std=c89</tt></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td><a href="#c99">C99</a></td>
<td><tt>-std=c99</tt></td>
<td class="unknown" align="center">Almost certainly</td>
</tr>
<tr>
<td><a href="#c11">C11</a></td>
<td><tt>-std=c11</tt></td>
<td class="unknown" align="center">Probably</td>
</tr>
<tr>
<td><a href="#c17">C17</a></td>
<td><tt>-std=c17</tt></td>
<td class="unknown" align="center">Maybe?</td>
</tr>
<tr>
<td><a href="#c2x">C2x</a></td>
<td><tt>-std=c2x</tt></td>
<td class="partial" align="center">Partial</td>
</tr>
</table>
<p>The implementation status for C99, C11, and C17 are currently under
investigation. Any proposal whose status in Clang is currently unknown
will be marked in <span class="unknown">magenta</span>.</p>
<p>The Clang community is continually striving to improve C standards
compliance between releases. We implement the resolution for defect
reports, but we do not currently track our DR status (help with
tracking DR status is appreciated).</p>
<p>The <a href="https://bugs.llvm.org/">LLVM bug tracker</a> contains a
Clang C component that tracks known bugs with Clang's language
conformance.</p>
<h2 id="c89">C89 implementation status</h2>
<p>Clang implements all of the ISO 9899:1990 (C89) standard.</p>
<p>You can use Clang in C89 mode with the <code>-std=c89</code> or <code>-std=c90</code> options.</p>
<h2 id="c99">C99 implementation status</h2>
<p>Clang implements a significant portion of the ISO 9899:1999 (C99) standard, but the status of individual proposals is still under investigation.</p>
<p>You can use Clang in C99 mode with the <code>-std=c99</code> option.</p>
<h2 id="c11">C11 implementation status</h2>
<p>Clang implements a significant portion of the ISO 9899:2011 (C11) standard, but the status of individual proposals is still under investigation.</p>
<p>You can use Clang in C11 mode with the <code>-std=c11</code> option (use <code>-std=c1x</code> in Clang 3.0 and earlier).</p>
<details>
<summary>List of features and minimum Clang version with support</summary>
<table width="689" border="1" cellspacing="0">
<tr>
<th>Language Feature</th>
<th>C11 Proposal</th>
<th>Available in Clang?</th>
</tr>
<tr>
<td>A finer-grained specification for sequencing</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1252.htm">N1252</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Clarification of expressions</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1282.pdf">N1282</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Extending the lifetime of temporary objects (factored approach)</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1285.htm">N1285</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Requiring signed char to have no padding bits</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1310.htm">N1310</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Initializing static or external variables</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1311.pdf">N1311</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Conversion between pointers and floating types</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1316.htm">N1316</a></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>Adding TR 19769 to the C Standard Library</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1326.pdf">N1326</a></td>
<td class="full" align="center">Clang 3.3</td>
</tr>
<tr>
<td>Static assertions</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1330.pdf">N1330</a></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>Parallel memory sequencing model proposal</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1349.htm">N1349</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Analyzability (#1, #4 - conditionally normative)</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1350.htm">N1350</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>FLT_EVAL_METHOD issues (first change only)</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1353.pdf">N1353</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>_Bool bit-fields</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1356.htm">N1356</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Technical corrigendum for C1X</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1359.htm">N1359</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Benign typedef redefinition</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1360.htm">N1360</a></td>
<td class="full" align="center">Clang 3.1</td>
</tr>
<tr>
<td>Thread-local storage</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1364.htm">N1364</a></td>
<td class="full" align="center">Clang 3.3</td>
</tr>
<tr>
<td>Constant expressions</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1365.htm">N1365</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Contractions and expression evaluation methods</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1367.htm">N1367</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>FLT_EVAL_METHOD and return</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1382.htm">N1382</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Floating-point to int/_Bool conversions</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1391.htm">N1391</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Analyzability (along the lines)</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1394.htm">N1394</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Wide function returns (alternate proposal)</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1396.htm">N1396</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr id="alignment">
<td rowspan="3">Alignment</td>
</tr>
<tr>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1397.htm">N1397</a></td>
<td class="full" align="center">Clang 3.2</td>
</tr>
<tr>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1447.htm">N1447</a></td>
<td class="full" align="center">Clang 3.2</td>
</tr>
<tr>
<td>Anonymous member-structures and unions (modulo "name lookup")</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1406.pdf">N1406</a></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>Completeness of types</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1439.pdf">N1439</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Generic macro facility</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1441.htm">N1441</a></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>Dependency ordering for C memory model</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1444.htm">N1444</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Subsetting the standard</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1460.htm">N1460</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Assumed types in F.9.2</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1468.htm">N1468</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Supporting the 'noreturn' property in C1x</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1478.htm">N1478</a></td>
<td class="full" align="center">Clang 3.3</td>
</tr>
<tr>
<td>Updates to C++ memory model based on formalization</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1480.htm">N1480</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Explicit initializers for atomics</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1482.htm">N1482</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Atomics proposal (minus ternary op)</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1485.pdf">N1485</a></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>UTF-8 string literals</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1488.htm">N1488</a></td>
<td class="full" align="center">Clang 3.3</td>
</tr>
<tr>
<td>Optimizing away infinite loops</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1509.pdf">N1509</a></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>Conditional normative status for Annex G</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1514.pdf">N1514</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Creation of complex value</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1464.htm">N1464</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Recommendations for extended identifier characters for C and C++</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1518.htm">N1518</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Atomic C1x/C++0x compatibility refinements (1st part only)</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1526.pdf">N1526</a></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>Atomic bitfields implementation defined</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1530.pdf">N1530</a></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>Small fix for the effect of alignment on struct/union type compatibility</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1532.htm">N1532</a></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>Synthesis re _Atomic</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1537.htm">N1537</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Clarification for wide evaluation</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1531.pdf">N1531</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
</table>
</details>
<h2 id="c17">C17 implementation status</h2>
<p>There are no major changes in this edition, only technical corrections and clarifications that are tracked by Defect Report.</p>
<p>You can use Clang in C17 mode with the <code>-std=c17</code> or <code>-std=c18</code> options (available in Clang 6 and later).</p>
<h2 id="c2x">C2x implementation status</h2>
<p>Clang has support for some of the features of the C standard following C17, informally referred to as C2x.</p>
<p>You can use Clang in C2x mode with the <code>-std=c2x</code> option (available in Clang 9 and later).</p>
<details open>
<summary>List of features and minimum Clang version with support</summary>
<table width="689" border="1" cellspacing="0">
<tr>
<th>Language Feature</th>
<th>C2x Proposal</th>
<th>Available in Clang?</th>
</tr>
<!-- Pre-Oct 2019 Papers -->
<tr>
<td>Evaluation formats</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2186.pdf">N2186</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Clarifying the restrict Keyword v2</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2260.pdf">N2660</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Harmonizing static_assert with C++</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2265.pdf">N2665</a></td>
<td class="full" align="center">Clang 9</td>
</tr>
<tr>
<td>nodiscard attribute</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2667.pdf">N2667</a></td>
<td class="full" align="center">Clang 9</td>
</tr>
<tr>
<td>maybe_unused attribute</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2670.pdf">N2670</a></td>
<td class="full" align="center">Clang 9</td>
</tr>
<tr id="TS18661">
<td rowspan="6">TS 18661 Integration</td>
</tr>
<tr> <!-- Pre-Oct 2019 -->
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2314.pdf">N2314</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr> <!-- Pre-Oct 2019 -->
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2341.pdf">N2341</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr> <!-- Pre-Oct 2019 -->
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2401.pdf">N2401</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr> <!-- Pre-Oct 2019 -->
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2359.pdf">N2359</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr> <!-- Nov 2020 -->
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2546.pdf">N2546</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Preprocessor line numbers unspecified</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2322.htm">N2322</a></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>deprecated attribute</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2334.pdf">N2334</a></td>
<td class="full" align="center">Clang 9</td>
</tr>
<tr id="Attributes">
<td rowspan="3">Attributes</td>
</tr>
<tr> <!-- Pre-Oct 2019 -->
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2335.pdf">N2335</a></td>
<td class="full" align="center">Clang 9</td>
</tr>
<tr> <!-- Aug 2020 -->
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2554.pdf">N2554</a></td>
<td class="full" align="center">Clang 9</td>
</tr>
<tr>
<td>Defining new types in offsetof</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm">N2350</a></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>fallthrough attribute</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2408.pdf">N2408</a></td>
<td class="full" align="center">Clang 9</td>
</tr>
<tr>
<td>Two's complement sign representation</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2412.pdf">N2412</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Adding the u8 character prefix</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2418.pdf">N2418</a></td>
<td class="none" align="center">No</td>
</tr>
<tr>
<td>Remove support for function definitions with identifier lists</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf">N2432</a></td>
<td class="none" align="center">No</td>
</tr>
<!-- Oct 2019 Papers -->
<tr>
<td>*_IS_IEC_60559 feature test macros</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2379.htm">N2379</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Floating-point negation and conversion</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2416.pdf">N2416</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Annex F.8 update for implementation extensions and rounding</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2384.pdf">N2384</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>_Bool definitions for true and false</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2393.pdf">N2393</a></td>
<td class="none" align="center">No</td>
</tr>
<!-- Mar 2020 Papers -->
<tr>
<td>[[nodiscard("should have a reason")]]</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2448.pdf">N2448</a></td>
<td class="full" align="center">Clang 10</td>
</tr>
<tr>
<td>Allowing unnamed parameters in function definitions</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2480.pdf">N2480</a></td>
<td class="full" align="center">Clang 11</td>
</tr>
<!-- Aug 2020 Papers -->
<tr>
<td>Free positioning of labels inside compound statements</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdf">N2508</a></td>
<td class="none" align="center">No</td>
</tr>
<tr>
<td>Clarification request for C17 example of undefined behavior</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2517.pdf">N2517</a></td>
<td class="none" align="center">No</td>
</tr>
<tr>
<td>Querying attribute support</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2553.pdf">N2553</a></td>
<td class="full" align="center">Clang 9</td>
</tr>
<!-- Nov 2020 Papers -->
<tr>
<td>Binary literals</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2549.pdf">N2549</a></td>
<td class="full" align="center">Clang 9</td>
</tr>
<tr>
<td>Allow duplicate attributes</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2557.pdf">N2557</a></td>
<td class="unreleased" align="center">Clang 13</td>
</tr>
<tr>
<td>Character encoding of diagnostic text</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2563.pdf">N2563</a></td>
<td class="full" align="center">Yes</td>
</tr>
<tr>
<td>What we think we reserve</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2572.pdf">N2572</a></td>
<td class="partial" align="center">Partial</td>
</tr>
<tr>
<td>Decimal floating-point triples</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2580.htm">N2580</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Remove mixed wide string literal concatenation</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2594.htm">N2594</a></td>
<td class="full" align="center">Clang 9</td>
</tr>
<tr>
<td>Update to IEC 60559:2020</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2600.pdf">N2600</a></td>
<td class="unknown" align="center">Unknown</td>
</tr>
<tr>
<td>Compatibility of Pointers to Arrays with Qualifiers</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2607.pdf">N2607</a></td>
<td class="partial" align="center">Partial</td>
</tr>
</table>
</details>
</div>
</body>
</html>