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

Dmitri Gribenko gribozavr at gmail.com
Mon Jan 23 06:40:44 PST 2012


On Fri, Jan 20, 2012 at 7:18 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> On Thu, Jan 19, 2012 at 1:11 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>> Attached is a patch that implements enhancement proposed in PR11329.
>>
>> As suggested by Argyrios, this patch implements:
>> * a stack of "CompoundScopeInfo"s, helper functions to push/pop them,
>> ActOn{Start,Finish}OfCompoundStatement callbacks;
>> * a check if the warning is actually enabled before doing costly checks.
>>
>> Doing this uncovered a bug in TreeTransfom, Sema::ActOnBlockError was
>> not called in all cases.  This is also fixed.
>>
>> I've ran a chromium build again and found 3 false positives (-1
>> because one previously affected file now builds with -Wno-empty-body).
>
> I accidentally sent an old version with an error.  Here's a correct version.

*ping*

Please review.  Patch rebased to latest trunk and split in two.

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>*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tree-transform-act-on-block-error.patch
Type: text/x-diff
Size: 1443 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120123/29e36888/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generalize-warn-empty-body-v9.patch
Type: text/x-diff
Size: 28184 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120123/29e36888/attachment-0001.patch>


More information about the cfe-commits mailing list