[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-patches
Subject:    Re: PING: [PATCH] C/C++: Implement -Wempty-body for do/while, clarify diagnostic
From:       Gabriel Dos Reis <gdr () cs ! tamu ! edu>
Date:       2007-02-14 1:10:10
Message-ID: 87odnxh7d9.fsf () soliton ! cs ! tamu ! edu
[Download RAW message or body]

Dirk Mueller <dmueller@suse.de> writes:

| On Saturday, 10. February 2007 23:43, Dirk Mueller wrote:
| 
| > bootstrapped and regtested against yesterdays trunk.
| 
| Actually I just notice I posted the wrong patch. the correct one is below. 
| 
| Any comments? Can at least the diagnostic clarification go in?
| 
| 
| Thanks,
| Dirk
| 2007-02-11  Dirk Mueller  <dmueller@suse.de>
| 
|         * 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.

The C++ and documentation parts are OK; you need a C maintainer to
look over the C bits (though they look OK to me).

-- Gaby
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic