[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Having fun with the following C code (UB)



Vincent Lefevre <vincent@vinc17.net> writes:

> The cases "m = d * C" and "m >= 0" are mostly the same, i.e. with the
> same false positives in practice. So, there's no reason to provide a
> warning for the second one only.

I don't think the GCC authors are just being dumb here.  There probably is
a reason; it's just probably buried in the compiler internals.

> Andrew Pinski said: "For the first warning, even though the warning is
> correct, I don't think we should warn here as the expressions are split
> between two different statements.", which is more or less my point here
> (the first overflow occurs before the "m >= 0").

Well, I strongly disagree for the reasons I stated in my previous message.
*shrug*

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: