aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2019-10-04 05:42:08 +0000
committerBernd Edlinger <edlinger@gcc.gnu.org>2019-10-04 05:42:08 +0000
commitcf09ecdb94d617f740e938c476252e61dffacc29 (patch)
tree8788fe109724e70501129ce1949e39d27f42b342
parent38b8d26b4604c3672678de6d8972ac254bb18793 (diff)
downloadgcc-cf09ecdb94d617f740e938c476252e61dffacc29.zip
gcc-cf09ecdb94d617f740e938c476252e61dffacc29.tar.gz
gcc-cf09ecdb94d617f740e938c476252e61dffacc29.tar.bz2
invoke.texi (-Wshadow=global, [...]): Fix description.
2019-10-04 Bernd Edlinger <bernd.edlinger@hotmail.de> * doc/invoke.texi (-Wshadow=global, -Wshadow=local, -Wshadow=compatible-local): Fix description. Add an example where -Wshadow=compatible-local does not warn. From-SVN: r276561
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/doc/invoke.texi9
2 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 54240d5..0c8f331 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2019-10-04 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * doc/invoke.texi (-Wshadow=global, -Wshadow=local,
+ -Wshadow=compatible-local): Fix description.
+ Add an example where -Wshadow=compatible-local does not
+ warn.
+
2019-10-03 John David Anglin <danglin@gcc.gnu.org>
* config/pa/pa.h (MAX_PCREL17F_OFFSET): Adjust.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index ac20e3a..0b56162 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -6477,13 +6477,14 @@ Do not warn whenever a local variable shadows an instance variable in an
Objective-C method.
@item -Wshadow=global
-@opindex Wshadow=local
+@opindex Wshadow=global
The default for @option{-Wshadow}. Warns for any (global) shadowing.
+This warning is enabled by @option{-Wshadow=global}.
@item -Wshadow=local
@opindex Wshadow=local
Warn when a local variable shadows another local variable or parameter.
-This warning is enabled by @option{-Wshadow=global}.
+This warning is enabled by @option{-Wshadow=local}.
@item -Wshadow=compatible-local
@opindex Wshadow=compatible-local
@@ -6515,8 +6516,10 @@ in place of the other, type checking will catch that and emit an error or
warning. So not warning (about shadowing) in this case will not lead to
undetected bugs. Use of this flag instead of @option{-Wshadow=local} can
possibly reduce the number of warnings triggered by intentional shadowing.
+Note that this does also mean that shadowing @code{const char *i} by
+@code{char *i} will not emit a warning.
-This warning is enabled by @option{-Wshadow=local}.
+This warning is enabled by @option{-Wshadow=compatible-local}.
@item -Wlarger-than=@var{byte-size}
@opindex Wlarger-than=