extra: tighten canonical for loop handling
commitf0c7037ce2f1ed1d09ed8367e817e645656ab8b7
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 7 Feb 2019 18:41:13 +0000 (7 21:41 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 7 Feb 2019 18:41:13 +0000 (7 21:41 +0300)
tree3bbe2a056607859a84df6cfcbc14384ab82be61a
parent94229e1f057af7069f2a8298c10cc42111b0354d
extra: tighten canonical for loop handling

I'm not totally sure about this patch.  It's technically more correct and
it does solve a real bug and probably most for loops have a distinct end
instead using a variable...

The problem was this:

for (i = 0; i < variable; i++) {

But it was saying the "implied max" of variable was s32max which is sort of
bogus and unfortunate.  But anyway, the for loop didn't have a break so
that means it exits with i == s32max.  If we just say that we don't know
how it ends that's more accurate.

Another thing is that these days we have smatch_comparison.c so maybe not
knowing is fine?

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_extra.c