aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2007-05-08 01:31:24 +0000
committerMike Stump <mrs@apple.com>2007-05-08 01:31:24 +0000
commit5c4b1f7ca57960152cf3e480310297ee41ce6a20 (patch)
tree37e00df220b8ab9eb5ac7e99af6a2be48f9819c4 /gcc/doc
parentce9788eec31c9a7f042f4094d61464227a8594ff (diff)
* doc/invoke.texi (Warning Options): Document that -Wempty-body
also checks for and while statements in C++. cp: * parser.c (check_empty_body): Add. (cp_parser_iteration_statement): Add call to check_empty_body. testsuite: * g++.old-deja/g++.mike/empty.C: Add. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@124534 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/invoke.texi11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index e608dbc017e..552e3b731b0 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -3157,6 +3157,11 @@ An empty body occurs in an @samp{if}, @samp{else} or
@samp{do while} statement. This warning can be independently
controlled by @option{-Wempty-body}.
+@item @r{(C++ only)}
+An empty body occurs in a @samp{while} or @samp{for} statement with no
+whitespacing before the semicolon. This warning can be independently
+controlled by @option{-Wempty-body}.
+
@item
A pointer is compared against integer zero with @samp{<}, @samp{<=},
@samp{>}, or @samp{>=}.
@@ -3421,8 +3426,10 @@ to them.
@item -Wempty-body
@opindex Wempty-body
-An empty body occurs in an @samp{if}, @samp{else} or @samp{do while}
-statement. This warning is also enabled by @option{-Wextra}.
+Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
+while} statement. Additionally, in C++, warn when an empty body occurs
+in a @samp{while} or @samp{for} statement with no whitespacing before
+the semicolon. This warning is also enabled by @option{-Wextra}.
@item -Wsign-compare
@opindex Wsign-compare