summaryrefslogtreecommitdiff
path: root/devdocs/c/language%2Fconformance.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/c/language%2Fconformance.html
new repository
Diffstat (limited to 'devdocs/c/language%2Fconformance.html')
-rw-r--r--devdocs/c/language%2Fconformance.html55
1 files changed, 55 insertions, 0 deletions
diff --git a/devdocs/c/language%2Fconformance.html b/devdocs/c/language%2Fconformance.html
new file mode 100644
index 00000000..63acf442
--- /dev/null
+++ b/devdocs/c/language%2Fconformance.html
@@ -0,0 +1,55 @@
+ <h1 id="firstHeading" class="firstHeading">Conformance</h1> <p><i>Conformance</i> has a three-fold definition:</p>
+<ul>
+<li> <i>strictly conforming program</i> - uses only well-defined language constructs, that is constructs with a single behavior. It excludes unspecified, undefined, or implementation-defined behavior, and does not exceed any minimum implementation limit. </li>
+<li> <i>conforming program</i> - acceptable to a conforming implementation. </li>
+<li> <i>conforming implementation</i> - <ul>
+<li> A conforming hosted implementation shall accept any strictly conforming program. </li>
+<li> A conforming freestanding implementation shall accept any strictly conforming program in which the use of the features specified in the library clause (clause 7) is confined to the contents of the freestanding standard library headers (see below). </li>
+<li> A conforming implementation may have extensions (including additional library functions), provided they do not alter the behavior of any strictly conforming program. </li>
+</ul> </li>
+</ul> <h3 id="Explanation"> Explanation</h3> <p>The standard does not define any minimum implementation limit on translation units. A hosted environment has an operating system; a freestanding environment does not. A program running in a hosted environment may use all features described in the library clause (clause 7); a program running in a freestanding environment may use a subset of library features required by clause 4.</p>
+<h4 id="Freestanding_standard_library_headers"> Freestanding standard library headers</h4> <p>All standard library features in every fully freestanding header are required to be provided by a freestanding implementation.</p>
+<table class="t-rev-begin"> <tr class="t-rev t-since-c23">
+<td> <p>Some standard library headers are conditionally freestanding.</p>
+<ul><li> If the implementation predefines the macro <code>__STDC_IEC_60559_BFP__</code> or <code>__STDC_IEC_60559_DFP__</code>, then <ul>
+<li> <a href="../numeric/math" title="c/numeric/math"><code>&lt;math.h&gt;</code></a> and <a href="../numeric/fenv" title="c/numeric/fenv"><code>&lt;fenv.h&gt;</code></a> are fully freestanding headers, and </li>
+<li> <a href="../program" title="c/program"><code>&lt;stdlib.h&gt;</code></a> is a partially freestanding header. </li>
+</ul> </li></ul> <p>In a partially freestanding header, only a part of standard library features are required to be provided by a freestanding implementation.</p>
+<ul>
+<li> <a href="../string/byte/strdup" title="c/string/byte/strdup"><code>strdup</code></a>, <a href="../string/byte/strndup" title="c/string/byte/strndup"><code>strndup</code></a>, <code><a href="../string/byte/strcoll" title="c/string/byte/strcoll">strcoll</a></code>, <code><a href="../string/byte/strxfrm" title="c/string/byte/strxfrm">strxfrm</a></code>, and <code><a href="../string/byte/strerror" title="c/string/byte/strerror">strerror</a></code> are not required to be provided by a freestanding implementation. </li>
+<li> When <code>__STDC_IEC_60559_BFP__</code> or <code>__STDC_IEC_60559_DFP__</code> are predefined, in <a href="../program" title="c/program"><code>&lt;stdlib.h&gt;</code></a>, only numeric conversion functions (<code>ato<i>X</i></code>, <code>strto<i>X</i></code>, and <code>strfrom<i>X</i></code>) are required to be provided by a freestanding implementation. </li>
+</ul> </td> <td><span class="t-mark-rev t-since-c23">(since C23)</span></td>
+</tr> </table> <table class="t-dsc-begin"> <tr> <td colspan="2"> <h5 id="Fully_freestanding_standard_library_headers"> Fully freestanding standard library headers </h5> </td>
+</tr> <tr class="t-dsc"> <td> <a href="../types/limits#Limits_of_floating_point_types" title="c/types/limits"><code>&lt;float.h&gt;</code></a> </td> <td> <a href="../types/limits#Limits_of_floating_point_types" title="c/types/limits">Limits of floating-point types</a> </td>
+</tr> <tr class="t-dsc"> <td> <a href="operator_alternative" title="c/language/operator alternative"><code>&lt;iso646.h&gt;</code></a> <span class="t-mark-rev t-since-c95">(since C95)</span> </td> <td> <a href="operator_alternative" title="c/language/operator alternative">Alternative operator spellings</a> </td>
+</tr> <tr class="t-dsc"> <td> <a href="../types/limits" title="c/types/limits"><code>&lt;limits.h&gt;</code></a> </td> <td> <a href="../types/limits" title="c/types/limits">Ranges of integer types</a> </td>
+</tr> <tr class="t-dsc"> <td> <a href="../types" title="c/types"><code>&lt;stdalign.h&gt;</code></a> <span class="t-mark-rev t-since-c11">(since C11)</span> </td> <td> <a href="../types" title="c/types"><code>alignas</code> and <code>alignof</code></a> convenience macros </td>
+</tr> <tr class="t-dsc"> <td> <a href="../variadic" title="c/variadic"><code>&lt;stdarg.h&gt;</code></a> </td> <td> <a href="../variadic" title="c/variadic">Variable arguments</a> </td>
+</tr> <tr class="t-dsc"> <td> <a href="../types" title="c/types"><code>&lt;stdbool.h&gt;</code></a> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> <td> <a href="../types" title="c/types">Macros for boolean type</a> </td>
+</tr> <tr class="t-dsc"> <td> <a href="../types" title="c/types"><code>&lt;stddef.h&gt;</code></a> </td> <td> <a href="../types" title="c/types">Common macro definitions</a> </td>
+</tr> <tr class="t-dsc"> <td> <a href="../types/integer" title="c/types/integer"><code>&lt;stdint.h&gt;</code></a> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> <td> <a href="../types/integer" title="c/types/integer">Fixed-width integer types</a> </td>
+</tr> <tr class="t-dsc"> <td> <a href="_noreturn" title="c/language/ Noreturn"><code>&lt;stdnoreturn.h&gt;</code></a> <span class="t-mark-rev t-since-c11">(since C11)</span> </td> <td> <a href="../types" title="c/types"><code>noreturn</code></a> convenience macro </td>
+</tr> <tr class="t-dsc"> <td> <code>&lt;stdbit.h&gt;</code> <span class="t-mark-rev t-since-c23">(since C23)</span> </td> <td> Macros to work with the byte and bit representations of types </td>
+</tr> <tr> <td colspan="2"> <h5 id="Partially_freestanding_standard_library_headers"> Partially freestanding standard library headers </h5> </td>
+</tr> <tr class="t-dsc"> <td> <a href="../string/byte" title="c/string/byte"><code>&lt;string.h&gt;</code></a> <span class="t-mark-rev t-since-c23">(since C23)</span> </td> <td> <a href="../string/byte" title="c/string/byte">String handling</a> </td>
+</tr> <tr> <td colspan="2"> <h5 id="Conditionally_fully_freestanding_standard_library_headers"> Conditionally fully freestanding standard library headers </h5> </td>
+</tr> <tr class="t-dsc"> <td> <a href="../numeric/fenv" title="c/numeric/fenv"><code>&lt;fenv.h&gt;</code></a> <span class="t-mark-rev t-since-c23">(since C23)</span> </td> <td> <a href="../numeric/fenv" title="c/numeric/fenv">Floating-point environment</a> </td>
+</tr> <tr class="t-dsc"> <td> <a href="../numeric/math" title="c/numeric/math"><code>&lt;math.h&gt;</code></a> <span class="t-mark-rev t-since-c23">(since C23)</span> </td> <td> <a href="../numeric/math" title="c/numeric/math">Common mathematics functions</a> </td>
+</tr> <tr> <td colspan="2"> <h5 id="Conditionally_partially_freestanding_standard_library_headers"> Conditionally partially freestanding standard library headers </h5> </td>
+</tr> <tr class="t-dsc"> <td> <a href="../program" title="c/program"><code>&lt;stdlib.h&gt;</code></a> <span class="t-mark-rev t-since-c23">(since C23)</span> </td> <td> General utilities: <a href="../memory" title="c/memory">memory management</a>, <a href="../program" title="c/program">program utilities</a>, <a href="../string" title="c/string">string conversions</a>, <a href="../numeric/random" title="c/numeric/random">random numbers</a>, <a href="../algorithm" title="c/algorithm">algorithms</a> </td>
+</tr> </table> <h3 id="References"> References</h3> <ul>
+<li> C17 standard (ISO/IEC 9899:2018): </li>
+<ul><li> 4 Conformance (p: 4) </li></ul>
+<li> C11 standard (ISO/IEC 9899:2011): </li>
+<ul><li> 4 Conformance (p: 8-9) </li></ul>
+<li> C99 standard (ISO/IEC 9899:1999): </li>
+<ul><li> 4 Conformance (p: 7-8) </li></ul>
+<li> C89/C90 standard (ISO/IEC 9899:1990): </li>
+<ul><li> 1.7 Compliance </li></ul>
+</ul> <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/freestanding" title="cpp/freestanding">C++ documentation</a></span> for <span class=""><span>Freestanding and hosted implementation</span></span> </td>
+</tr> </table> <div class="_attribution">
+ <p class="_attribution-p">
+ &copy; cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br>
+ <a href="https://en.cppreference.com/w/c/language/conformance" class="_attribution-link">https://en.cppreference.com/w/c/language/conformance</a>
+ </p>
+</div>