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/gcc~13/mixed-labels-and-declarations.html | |
new repository
Diffstat (limited to 'devdocs/gcc~13/mixed-labels-and-declarations.html')
| -rw-r--r-- | devdocs/gcc~13/mixed-labels-and-declarations.html | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/devdocs/gcc~13/mixed-labels-and-declarations.html b/devdocs/gcc~13/mixed-labels-and-declarations.html new file mode 100644 index 00000000..14875f09 --- /dev/null +++ b/devdocs/gcc~13/mixed-labels-and-declarations.html @@ -0,0 +1,10 @@ +<div class="section-level-extent" id="Mixed-Labels-and-Declarations"> <div class="nav-panel"> <p> Next: <a href="function-attributes" accesskey="n" rel="next">Declaring Attributes of Functions</a>, Previous: <a href="cast-to-union" accesskey="p" rel="prev">Cast to a Union Type</a>, Up: <a href="c-extensions" accesskey="u" rel="up">Extensions to the C Language Family</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div> <h1 class="section" id="Mixed-Declarations_002c-Labels-and-Code"><span>6.32 Mixed Declarations, Labels and Code<a class="copiable-link" href="#Mixed-Declarations_002c-Labels-and-Code"> ¶</a></span></h1> <p>ISO C99 and ISO C++ allow declarations and code to be freely mixed within compound statements. ISO C2X allows labels to be placed before declarations and at the end of a compound statement. As an extension, GNU C also allows all this in C90 mode. For example, you could do: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">int i; +/* <span class="r">…</span> */ +i++; +int j = i + 2;</pre> +</div> <p>Each identifier is visible from where it is declared until the end of the enclosing block. </p> </div><div class="_attribution"> + <p class="_attribution-p"> + © Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br> + <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Mixed-Labels-and-Declarations.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Mixed-Labels-and-Declarations.html</a> + </p> +</div> |
