| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* c-common.h (empty_body_warning): Rename to empty_if_body_warning.
* c-common.c (empty_if_body_warning): Rephrase diagnostic message.
* c-parser.c (c_parser_if_body): Always add an empty statement in case
of empty body.
* c-parser.c (c_parser_do_statement): Warn about empty body in
do/while statement.
* c-typeck (c_finish_if_stmt): Call empty_if_body_warning.
* doc/invoke.texi (-Wempty-body): Update documentation.
* cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
(finish_do_body): Warn about empty body in do/while statement.
* g++.dg/warn/do-empty.C: New.
* gcc.dg/do-empty.c: New.
* gcc.dg/if-empty-1.c: Update.
* gcc.dg/20001116-1.c: Update.
* gcc.dg/pr23165.c: Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122928 138bc75d-0d04-0410-961f-82ee72b054a4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR middle-end/7651
* c.opt (Wempty-body): New.
* doc/invoke.texi (Wempty-body): Document it.
(Wextra): Enabled by -Wextra.
* c-opts.c (c_common_post_options): Enabled by -Wextra.
* c-common.c (empty_body_warning): Replace Wextra with Wempty-body.
* c-parser.c (c_parser_c99_block_statement): Likewise.
testsuite/
* gcc.dg/20001116-1.c: Replace -Wextra with -Wempty-body.
* gcc.dg/if-empty-1.c: Likewise.
* gcc.dg/pr23165.c: Likewise.
* g++.dg/warn/empty-body.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119963 138bc75d-0d04-0410-961f-82ee72b054a4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(if_prefix): Increment stmt_count; pass it to c_finish_if_cond.
(select_or_iter_stmt): Move empty if warnings to c-typeck.c.
* c-typeck.c (if_elt): Sort by expected size. Rename locus to
empty_locus. Add stmt_count, saw_else.
(c_begin_if_stmt): Push if_stack here.
(c_finish_if_cond): Rename from c_expand_end_cond. Record stmt_count.
(c_finish_then, c_finish_else): Record empty_locus.
(c_begin_else): Rename from c_expand_start_else. Record stmt_count.
(c_finish_if_stmt): Rename from c_expand_end_cond. Warn for empty
if or else body.
* c-tree.h: Update prototypes.
testsuite/
* gcc.dg/20001116-1.c: Move expected warning line.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83274 138bc75d-0d04-0410-961f-82ee72b054a4
|
|
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37521 138bc75d-0d04-0410-961f-82ee72b054a4
|