aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoff Johnstone <geoff.johnstone@googlemail.com>2008-04-21 11:53:48 -0700
committerJosh Triplett <josh@freedesktop.org>2008-04-21 11:53:48 -0700
commit32dd96be4de207b09559d9b71c4cd6f7cb0cb4e2 (patch)
treeb73d3dece1a2f38f3a6daf78ac4c4d51691322f2 /sparse.1
parentimprove -Wcontext code and messages (diff)
downloadsparse-32dd96be4de207b09559d9b71c4cd6f7cb0cb4e2.tar.gz
sparse-32dd96be4de207b09559d9b71c4cd6f7cb0cb4e2.tar.bz2
sparse-32dd96be4de207b09559d9b71c4cd6f7cb0cb4e2.zip
Add -Wno-declaration-after-statement
This adds -W[no-]declaration-after-statement, which makes warnings about declarations after statements a command-line option. (The code to implement the warning was already in there via a #define; the patch just exposes it at runtime.) Rationale: C99 allows them, C89 doesn't. Signed-off-by: Geoff Johnstone <geoff.johnstone@googlemail.com>
Diffstat (limited to 'sparse.1')
-rw-r--r--sparse.110
1 files changed, 10 insertions, 0 deletions
diff --git a/sparse.1 b/sparse.1
index 713cf99..d242dc7 100644
--- a/sparse.1
+++ b/sparse.1
@@ -135,6 +135,16 @@ Sparse issues these warnings by default. To turn them off, use
\fB\-Wno\-decl\fR.
.
.TP
+.B \-Wdeclaration-after-statement
+Warn about declarations that are not at the start of a block.
+
+These declarations are permitted in C99 but not in C89.
+
+Sparse issues these warnings by default only when the C dialect is
+C89 (i.e. -ansi or -std=c89). To turn them off, use
+\fB\-Wno\-declaration\-after\-statement\fR.
+.
+.TP
.B \-Wdefault\-bitfield\-sign
Warn about any bitfield with no explicit signedness.