This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52961] Missing warning on empty if
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 09 Oct 2012 16:41:17 +0000
- Subject: [Bug c++/52961] Missing warning on empty if
- Auto-submitted: auto-generated
- References: <bug-52961-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52961
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |paolo.carlini at oracle dot
| |com
--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-09 16:41:17 UTC ---
Then, likely this could be resolved very quickly but what in means exactly to
have the warning by default here? Change:
if (!cp_lexer_next_token_is_keyword (parser->lexer, RID_ELSE))
warning_at (loc, OPT_Wempty_body, "suggest braces around "
"empty body in an %<if%> statement");
to
if (!cp_lexer_next_token_is_keyword (parser->lexer, RID_ELSE))
warning_at (loc, 0, "suggest braces around "
"empty body in an %<if%> statement");
?? It makes sense to me because I don't think somebody may want to suppress the
warning and keep this kind of code, but wanted to confirm.