diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/c/language%2Fattributes%2Fnoreturn.html | |
new repository
Diffstat (limited to 'devdocs/c/language%2Fattributes%2Fnoreturn.html')
| -rw-r--r-- | devdocs/c/language%2Fattributes%2Fnoreturn.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/devdocs/c/language%2Fattributes%2Fnoreturn.html b/devdocs/c/language%2Fattributes%2Fnoreturn.html new file mode 100644 index 00000000..6d75ac4c --- /dev/null +++ b/devdocs/c/language%2Fattributes%2Fnoreturn.html @@ -0,0 +1,24 @@ + <h1 id="firstHeading" class="firstHeading">C attribute: noreturn, _Noreturn <span class="t-mark-rev t-since-c23">(since C23)</span> +</h1> <p>Indicates that the function does not return.</p> +<h3 id="Syntax"> Syntax</h3> <table class="t-sdsc-begin"> <tr class="t-sdsc"> <td> <code>[[</code> <code>noreturn</code> <code>]]</code><br><code>[[</code> <code>__noreturn__</code> <code>]]</code> </td> <td class="t-sdsc-nopad"> </td> <td> </td> +</tr> <tr class="t-sdsc"> <td> <code>[[</code> <code>_Noreturn</code> <code>]]</code><br><code>[[</code> <code>___Noreturn__</code> <code>]]</code> </td> <td class="t-sdsc-nopad"> </td> <td> <span class="t-mark">(deprecated)</span> </td> +</tr> +</table> <h3 id="Explanation"> Explanation</h3> <p>Indicates that the function does not return.</p> +<p>This attribute applies to the name of the function and specifies that the function does not return by executing the return statement or by reaching the end of the function body (it may return by executing <code><a href="../../program/longjmp" title="c/program/longjmp">longjmp</a></code>). The behavior is undefined if the function with this attribute actually returns. A compiler diagnostic is recommended if this can be detected.</p> +<p>It has been previously denoted by the keyword <a href="../_noreturn" title="c/language/ Noreturn"><code>_Noreturn</code></a> until it was deprecated since C23 and replaced by this attribute.</p> +<h3 id="Standard_library"> Standard library</h3> <p>The following standard functions are declared with <code>noreturn</code> attribute (they used to be declared with <a href="../_noreturn" title="c/language/ Noreturn"><code>_Noreturn</code></a> specifier until C23):</p> +<ul> +<li> <code><a href="../../program/abort" title="c/program/abort">abort()</a></code> </li> +<li> <code><a href="../../program/exit" title="c/program/exit">exit()</a></code> </li> +<li> <code><a href="../../program/_exit" title="c/program/ Exit">_Exit()</a></code> </li> +<li> <code><a href="../../program/quick_exit" title="c/program/quick exit">quick_exit()</a></code> </li> +<li> <code><a href="../../thread/thrd_exit" title="c/thread/thrd exit">thrd_exit()</a></code> </li> +<li> <code><a href="../../program/longjmp" title="c/program/longjmp">longjmp()</a></code> </li> +</ul> <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td colspan="2"> <span><a href="../_noreturn" title="c/language/ Noreturn">C documentation</a></span> for <code>_Noreturn</code> </td> +</tr> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/language/attributes/noreturn" title="cpp/language/attributes/noreturn">C++ documentation</a></span> for <code>[[noreturn]]</code> </td> +</tr> </table> <div class="_attribution"> + <p class="_attribution-p"> + © cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br> + <a href="https://en.cppreference.com/w/c/language/attributes/noreturn" class="_attribution-link">https://en.cppreference.com/w/c/language/attributes/noreturn</a> + </p> +</div> |
