Re: Coverity check please...

2025-01-19 Thread James Browning via devel
On Sunday, January 19, 2025 12:32:01 AM Pacific Standard Time Hal Murray via devel wrote: > I think it's a bug in Coverity. Would somebody please check. > > Is there a way to report bugs to Coverity? Or tell it not to check > something? It looks like one to me. I looked at the subject code and

Coverity check please...

2025-01-19 Thread Hal Murray via devel
I think it's a bug in Coverity. Would somebody please check. Is there a way to report bugs to Coverity? Or tell it not to check something? It's getting here with n =2 11. known_value_assign: j = n, its value is now 2. 471i = 0; j = n; 472m = n - (n * 4) / 10; (n*4)/10 is 0,

Re: Coverity check please...

2025-01-19 Thread Hal Murray via devel
> It looks like one to me. Thanks. > - m = n - (n * 4) / 10; > + m = n - ((n * 4) / 10); I wondered about that too. Seems unlikely, but ... So, I tried it. It didn't help. Anybody know how to report bugs to Coverity? I poked around a bit but didn't find it. -- These are my

Re: Coverity check please...

2025-01-19 Thread Gary E. Miller via devel
Yo Hal! On Sun, 19 Jan 2025 00:32:01 -0800 Hal Murray via devel wrote: > I think it's a bug in Coverity. Would somebody please check. I agree with coverity. > Is there a way to report bugs to Coverity? Or tell it not to check > something? Not that I know of, and we would need a bug first.

Re: Coverity check please...

2025-01-19 Thread Hal Murray via devel
Gary said: > Since j is 2, andi is 3, subtracting i from j caused integer wrap, which > is undefined. 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. We get here with n=2 It looks to me like m gets initialized to 2. Do

Re: Coverity check please...

2025-01-19 Thread Gary E. Miller via devel
Yo Hal! On Sun, 19 Jan 2025 20:18:52 -0800 Hal Murray wrote: > Gary said: > > Since j is 2, andi is 3, subtracting i from j caused integer wrap, > > which is undefined. > > That assumes it goes around the loop a couple of times. But it > doesn't go around the loop even once -- or I'm confus

Re: Coverity check please...

2025-01-19 Thread Hal Murray via devel
[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