On Mon, Feb 6, 2012 at 1:55 PM, Richard Trieu <[email protected]> wrote:
> The motivation of this path is to catch code like this:
>
> for (int i = 0; i < 10; ++i)
>   for (int j = 0; j < 10; ++i)
>     { }
>
> The second for loop increments i instead of j causing an infinite loop.  The
> warning also checks the body of the for loop so it will trigger on:
>
> for (int i; i <10; ) { }
>
> But not trigger on:
>
> for (int i; i< 10; ) { ++i; }
>
> I'm still fine-tuning the trigger conditions, but would like some feedback
> on this patch.

Adding an additional recursive traversal of the body of every parsed
for loop is very expensive.

-Eli

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to