diff options
author | Mike Stump <mrs@apple.com> | 2007-05-08 01:31:24 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 2007-05-08 01:31:24 +0000 |
commit | 841cc7daf3e285036b0468ce9eb28695a8080e98 (patch) | |
tree | 37e00df220b8ab9eb5ac7e99af6a2be48f9819c4 /gcc/doc | |
parent | 79d37e4574ed6ca0c6fbd189b62f84cb8e90450a (diff) | |
download | gcc-841cc7daf3e285036b0468ce9eb28695a8080e98.zip gcc-841cc7daf3e285036b0468ce9eb28695a8080e98.tar.gz gcc-841cc7daf3e285036b0468ce9eb28695a8080e98.tar.bz2 |
invoke.texi (Warning Options): Document that -Wempty-body also checks for and while statements in C++.
* 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.
From-SVN: r124534
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index e608dbc..552e3b7 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 |