[www-patch] Document new -Wshadow= variants in gcc-7/changes.html
Gerald Pfeifer
gerald@pfeifer.com
Wed Nov 23 07:44:00 GMT 2016
A few markup fixes on top of the committed patch that I just
applied.
Essentially <blockquote> must not be within <p> and </li> was
missing in one case.
Thanks again for providing this nice documentation!
Gerald
Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-7/changes.html,v
retrieving revision 1.27
retrieving revision 1.30
diff -u -r1.27 -r1.30
--- changes.html 22 Nov 2016 10:14:25 -0000 1.27
+++ changes.html 23 Nov 2016 07:38:58 -0000 1.30
@@ -131,7 +131,9 @@
shadowing variable can be converted to that of the shadowed variable).</p>
<p>The following example shows the different kinds of shadow
-warnings:<blockquote><pre>
+warnings:</p>
+
+<blockquote><pre>
enum operation { add, count };
struct container { int nr; };
@@ -145,34 +147,41 @@
r += count.nr;
}
return r;
-}</pre></blockquote></p>
+}</pre></blockquote>
<p><code>-Wshadow=compatible-local</code> will warn for the parameter being
-shadowed with the same type:<blockquote><pre>
+shadowed with the same type:</p>
+
+<blockquote><pre>
<b>warn-test.c:8:12:</b> <span class="boldmagenta">warning:</span> declaration of '<b>count</b>' shadows a parameter [<span class="boldmagenta">-Wshadow=compatible-local</span>]
for (int <span class="boldmagenta">count</span> = 0; count > 0; count--)
<span class="boldmagenta">^~~~~</span>
<b>warn-test.c:5:42:</b> <span class="boldcyan">note:</span> shadowed declaration is here
container_count (struct container c, int <span class="boldcyan">count</span>)
- <span class="boldcyan">^~~~~</span></pre></blockquote></p>
+ <span class="boldcyan">^~~~~</span></pre></blockquote>
<p><code>-Wshadow=local</code> will warn for the above and for the shadowed
-declaration with incompatible type:<blockquote><pre>
+declaration with incompatible type:</p>
+
+<blockquote><pre>
<b>warn-test.c:10:24:</b> <span class="boldmagenta">warning:</span> declaration of '<b>count</b>' shadows a previous local [<span class="boldmagenta">-Wshadow=local</span>]
struct container <span class="boldmagenta">count</span> = c;
<span class="boldmagenta">^~~~~</span>
<b>warn-test.c:8:12:</b> <span class="boldcyan">note:</span> shadowed declaration is here
for (int <span class="boldcyan">count</span> = 0; count > 0; count--)
- <span class="boldcyan">^~~~~</span></pre></blockquote></p>
+ <span class="boldcyan">^~~~~</span></pre></blockquote>
<p><code>-Wshadow=global</code> will warn for all of the above and the shadowing
-of the global declaration: <blockquote><pre>
+of the global declaration:</p>
+
+<blockquote><pre>
<b>warn-test.c:5:42:</b> <span class="boldmagenta">warning:</span> declaration of '<b>count</b>' shadows a global declaration [<span class="boldmagenta">-Wshadow</span>]
container_count (struct container c, int <span class="boldmagenta">count</span>)
<span class="boldmagenta">^~~~~</span>
<b>warn-test.c:1:23:</b> <span class="boldcyan">note:</span> shadowed declaration is here
enum operation { add, <span class="boldcyan">count</span> };
- <span class="boldcyan">^~~~~</span></pre></blockquote></p></li>
+ <span class="boldcyan">^~~~~</span></pre></blockquote>
+</li>
</ul>
<h3 id="c">C</h3>
More information about the Gcc-patches
mailing list