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

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


On Feb 14, 2012, at 6:39 AM, Dmitri Gribenko wrote:

> On Tue, Feb 14, 2012 at 5:28 AM, Argyrios Kyrtzidis <kyrtzidis at apple.com> wrote:
>> Do you have cases (from e.g. llvm/clang or chromium, etc.) where the warning found an actual bug in a place where there was a semicolon in the same line but next statement was not compound statement and it didn't have more indentation ?
> 
> No, I don't.

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.

And thanks for your work, it's a great enhancement to the clang warnings!

-Argyrios

> 
> 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>*/
> _______________________________________________
> 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