path: root/cparser.1
diff options
authorChristoph Mallon <>2011-06-15 18:47:29 +0200
committerChristoph Mallon <>2011-06-15 18:52:00 +0200
commit10f02d1bde320a2e519229e7b21b4b4741bf381a (patch)
tree91802fbcdd55ac86705f1c0047a3b9388cdfe4df /cparser.1
parent66285deadc46366723208fad0adcf28c5dc4f36d (diff)
Implement and document -Wshadow-local.
- This works like -Wshadow, but only warns if the shadowed declaration is not global. - Activate it with -Wall. - Demote -Wshadow to -Wextra.
Diffstat (limited to 'cparser.1')
1 files changed, 6 insertions, 1 deletions
diff --git a/cparser.1 b/cparser.1
index 3470227..3700bd9 100644
--- a/cparser.1
+++ b/cparser.1
@@ -119,7 +119,7 @@ In particular these are
.Fl Wpointer-arith ,
.Fl Wredundant-decls ,
.Fl Wreturn-type ,
-.Fl Wshadow ,
+.Fl Wshadow-local ,
.Fl Wsign-compare ,
.Fl Wstrict-prototypes ,
.Fl Wswitch-enum ,
@@ -152,6 +152,7 @@ Generate an error, when calling a function without a prior declaration.
Activate some more warnings.
In particular these are
.Fl Wempty-statement ,
+.Fl Wshadow ,
.Fl Wunused-parameter ,
.Fl Wunused-value .
.It Fl Wfatal-errors
@@ -207,6 +208,10 @@ Warn if + or - is used as operand of << or >>, e.g. x\ +\ y\ <<\ z.
Warn about redundant declarations, i.e. multiple declarations of the same object or static forward declarations which have no use before their definition.
.It Fl Wshadow
Warn when a new declaration shadows another declaration with the same name in an outer scope.
+.It Fl Wshadow-local
+.Fl Wshadow ,
+but only warn if the shadowed declaration is not global, e.g. a local variable shadows a parameter or another local variable.
.It Fl Wunreachable-code
Warn when the compiler determines that a statement (or in some cases a part thereof) will never be executed.
.It Fl Wunused