[Bug c++/52961] Make -Wempty-body less noisy and enable it with -Wall

2019-04-19 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52961

--- Comment #12 from Eric Gallager  ---
(In reply to Manuel López-Ibáñez from comment #10)
> Clang... suggests placing the ";" on a different line to silence
> the warning:
> 
> 
> warning: if statement has empty body [-Wempty-body]
>   if(a);
>^
> note: put the semicolon on a separate line to silence this warning
> 
> which seems a nicer way to silence the warning instead of ugly { ; }

That's a debatable opinion; I think the braces do a better job expressing
grouping

[Bug c++/52961] Make -Wempty-body less noisy and enable it with -Wall

2017-08-22 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52961

Eric Gallager  changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-22
 CC||egallager at gcc dot gnu.org
 Ever confirmed|0   |1
   Severity|normal  |minor

--- Comment #11 from Eric Gallager  ---
(In reply to Paolo Carlini from comment #9)
> Uhm, I was under the impression that the other 2 used to give problems and
> that's why we don't warn anymore by default. Bah. All in all, given that we
> have the warning anyway, I don't think this is really an high priority
> issue, if you see what I mean ;)

ok, changing importance from "normal" to "minor" then (and confirming)

[Bug c++/52961] Make -Wempty-body less noisy and enable it with -Wall

2014-11-12 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52961

Manuel López-Ibáñez manu at gcc dot gnu.org changed:

   What|Removed |Added

Summary|Missing warning on empty if |Make -Wempty-body less
   ||noisy and enable it with
   ||-Wall

--- Comment #10 from Manuel López-Ibáñez manu at gcc dot gnu.org ---
This warning is too noisy because it warns for:

if(a)
  ;
return 2;

which is often the result of macro expansion. Clang specifically does not warn
for this and suggests placing the ; on a different line to silence the
warning:


warning: if statement has empty body [-Wempty-body]
  if(a);
   ^
note: put the semicolon on a separate line to silence this warning

which seems a nicer way to silence the warning instead of ugly { ; }