[cfe-commits] [PATCH][PR11329][v14] Generalize -Wempty-body: warn when statement body is empty

Argyrios Kyrtzidis kyrtzidis at apple.com
Tue Feb 14 14:10:27 PST 2012


On Feb 14, 2012, at 2:01 PM, Dmitri Gribenko wrote:

> On Tue, Feb 14, 2012 at 8:44 PM, Argyrios Kyrtzidis <kyrtzidis at apple.com> wrote:
>> Well, at least it doesn't change previous behavior, clang was already warning on "if"s with empty semicolon, so please go ahead and commit your patch, we can always revisit whether we should revise how this case is handled later on.
> 
> Thank you for your reviews.
> 
> Before I commit, how should I deal with the noisy false positive in
> llvm/CodeGen/MachineDominators.h?  Should I just commit the trivial
> fix (attached) or a post to llvm-commits is necessary?

Just commit, but do note at the commit log that there would be no warning if the next statement did not have more indentation; just to re-assure everybody that we are not going to just always warn for empty loop bodies.

> 
> Dmitri
> 
> -- 
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
> <machine-dominators-h-empty-body.patch>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list