[PATCH] Warn on suspicious increments/decrements in for loops
Richard Trieu
rtrieu at google.com
Fri May 31 14:46:15 PDT 2013
On Fri, May 31, 2013 at 2:24 PM, Richard Smith <richard at metafoo.co.uk>wrote:
> On Fri, May 31, 2013 at 2:04 PM, Richard Trieu <rtrieu at google.com> wrote:
>
>>
>> @jordan_rose, I want this warning. Not sure about other people
>>
>> @gribozavr, earlier versions of this did trigger on LLVM and Clang.
>> The warning has been fine-tuned since then to avoid those false positives.
>>
>> Also, I seemed to have messed up the indentation when I wrote the
>> visitors for the first -Wloop-analysis warning and managed to copy the bad
>> indentation over to this change. I will go fix them.
>
>
> Does this find any other bugs (or false positives) in other code you've
> run it on?
>
This has found 15-20 bugs so far, with 1-2 false positives. It is
arguable that using (x+=2) in the loop header instead of two separate
increments would be clearer for the code.
>
>
>> http://llvm-reviews.chandlerc.com/D628
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130531/70fa093c/attachment.html>
More information about the cfe-commits
mailing list