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

Dmitri Gribenko gribozavr at gmail.com
Wed Jan 4 13:25:41 PST 2012


On Wed, Jan 4, 2012 at 11:17 PM, Anna Zaks <ganna at apple.com> wrote:
> On Jan 4, 2012, at 11:44 AM, Dmitri Gribenko wrote:
>> I agree that we might want to reduce false positive rate for `for' and
>> `while' statements, but more elaborate ways (for example, checking if
>> the statement is followed by a CompoundStmt) would require shifting
>> this to static analyzer.
>
> This would still be a syntactic check. Why can't it be part of sema checking?

Isn't that too much work for an on-by-default warning?

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



More information about the cfe-commits mailing list