I am trying to use Frama-C value analysis to study a large generated C code where the bound checks are done using a bitwise AND (&) instead of a logical AND (&&). For instance:
int t[3];
...
if ((0 <= x) & (x < 3))
t[x] = 0;
Frama-C value analysis complains about the array access :
warning: accessing out of bounds index [-2147483648..2147483647]. assert 0 ≤ x < 3;
I managed to make it happy on small examples by adding assertions before the test:
//@ assert (x < 0 || 0<=x);
//@ assert (x < 3 || 3<=x);
and increasing the slevel
but I can't do that in real code (too large !).
Does anybody have an idea of what I can do to remove this alarm ?
(BTW is there any reason to write the tests that way ?)