Coverity check please...

Hal Murray halmurray at sonic.net
Mon Jan 20 05:17:17 UTC 2025


[I fatfingered something the first try and it didn't go to the list.]

>> That assumes it goes around the loop a couple of times.  But it
>> doesn't go around the loop even once -- or I'm confused.

Gary said:
> While is executed before forst loop iteration.

Coverty doesn't complain until the 3rd or 4th try.

>       12. Condition j - i > m, taking true branch.
>       16. Condition j - i > m, taking true branch.
>       20. Condition j - i > m, taking true branch.
>       CID 497295: (#1 of 1): Overflowed constant (INTEGER_OVERFLOW) 24.
> overflow_const: Expression j - i, where j is known to be equal to 2, and
> i is known to be equal to 3, underflows the type of j - i, which is type
> unsigned long. 
> 473        while ((j - i) > m) {



-- 
These are my opinions.  I hate spam.





More information about the devel mailing list