Open dbeecham opened 6 years ago
This is a fun one! Check this one out: https://github.com/nemequ/munit/blob/master/munit.c#L755
r - (start - stop)... is mathematically equal to r + (stop - start). The conditional is unnecessary. :)
r - (start - stop)
r + (stop - start)
Found it using gcc -Wduplicated-branches.
gcc -Wduplicated-branches
This seems like a false positive to me. The variables are all unsigned 64-bit integers. If, for example, start < stop, then start - stop will be a very large positive number, not a negative.
start < stop
start - stop
This is a fun one! Check this one out: https://github.com/nemequ/munit/blob/master/munit.c#L755
r - (start - stop)
... is mathematically equal tor + (stop - start)
. The conditional is unnecessary. :)Found it using
gcc -Wduplicated-branches
.