summaryrefslogtreecommitdiffhomepage
path: root/cparser.1
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2008-12-07 17:57:27 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2008-12-07 17:57:27 +0100
commitabfe00dd0c1451f075c0a5863d44259ef8891657 (patch)
tree4b7569214cf4ed19b4f90278f4163320aeebee5a /cparser.1
parent50f3b6c78da4dbfab627adf5b9eb52aaffc3cebd (diff)
Implement -Wparentheses.
[r24375]
Diffstat (limited to 'cparser.1')
-rw-r--r--cparser.113
1 files changed, 10 insertions, 3 deletions
diff --git a/cparser.1 b/cparser.1
index 1421688..c16c232 100644
--- a/cparser.1
+++ b/cparser.1
@@ -1,5 +1,5 @@
.\" Please adjust this date whenever revising the manpage.
-.Dd November 29, 2008
+.Dd December 7, 2008
.Dt CPARSER 1
.Sh NAME
.Nm cparser
@@ -114,6 +114,7 @@ In particular these are
.Fl Winit-self ,
.Fl Wmain ,
.Fl Wnonnull ,
+.Fl Wparentheses ,
.Fl Wpointer-arith ,
.Fl Wredundant-decls ,
.Fl Wreturn-type ,
@@ -178,6 +179,12 @@ Warn if a global function is defined without a previous prototype declaration.
Warn if a multicharacter constant ('FOOF') is used.
.It Fl Wnested-externs
Warn if an 'extern' declaration is encountered within a function.
+.It Fl Wparentheses
+Warn if parentheses are omitted in certain contexts.
+Warn if an assignment is used as condition, e.g. if\ (x\ =\ 23).
+Warn if && without parentheses is used within ||, e.g. if\ (x\ ||\ y\ &&\ z).
+Warn if it there may be confusion which 'if'-statement an 'else'-branch belongs to, e.g. if\ (x)\ if\ (y)\ {}\ else\ {}.
+Warn if cascaded comparisons appear which do not have their mathematical meaning, e.g. if\ (23\ <=\ x\ <\ 42).
.It Fl Wredundant-decls
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 Wunreachable-code
@@ -190,9 +197,9 @@ Activate
.Fl Wunused-value ,
.Fl Wunused-variable .
.It Fl Wunused-parameter
-Warn when a parameter is never used or only ever read to calculate its own new value, e.g. x = x + 1.
+Warn when a parameter is never used or only ever read to calculate its own new value, e.g. x\ =\ x\ +\ 1.
.It Fl Wunused-variable
-Warn when a variable is never used or only ever read to calculate its own new value, e.g. x = x + 1.
+Warn when a variable is never used or only ever read to calculate its own new value, e.g. x\ =\ x\ +\ 1.
.It Fl w
Suppress all warnings.
.It Fl I Ar dir