diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-08 01:31:24 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-08 01:31:24 +0000 |
commit | cc742166738d2d36fbace4160b3c278a49c215f6 (patch) | |
tree | 37e00df220b8ab9eb5ac7e99af6a2be48f9819c4 /gcc/doc | |
parent | 4037e5c3d0e08a67443723611b7346a63f00e1fd (diff) | |
download | gcc-cc742166738d2d36fbace4160b3c278a49c215f6.tar.gz |
* 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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124534 138bc75d-0d04-0410-961f-82ee72b054a4
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 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 |