[PATCH PING] (PR c++/5520) Implement empty-body warning for if() statements

Joseph S. Myers joseph@codesourcery.com
Wed Jan 18 18:31:00 GMT 2006


On Wed, 18 Jan 2006, Dirk Mueller wrote:

> On Monday 16 January 2006 03:09, Joseph S. Myers wrote:
> 
> > You'll need to format this in the standard way
> 
> Ok, thanks for your help. I hope I managed to do that correctly now :)
> 
> Okay for trunk?

The C changes are OK for trunk, with the following additional formatting 
notes:

> 2006-01-06  Dirk Mueller  <dmueller@suse.com>
> 
> 	PR c++/5520
> 	* semantics.c (finish_if_stmt): call empty_body_warning
> 	* parser.c (cp_parser_implicitly_scoped_statement):
> 	  mark empty statement with an empty stmt

Capital letter at start of entry for each file ("Call", "Mark"), "." at 
end of entry for each file, no extra indentation for second line for a 
file (just the standard TAB at the start of each line).

> +/* Print a warning about if (); or if () .. else; constructs
> +   via the special empty statement node that we create. inner_then
> +   and inner_else are the statement lists of the if and the else
> +   else block.  */

Say INNER_THEN and INNER_ELSE (all capitals) in comments, per the GNU 
Coding Standards.  Two spaces after "." at end of sentence (after 
"create", you already have it correct at the end of the comment).
"else else" looks wrong".

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)



More information about the Gcc-patches mailing list