[Bug c/68971] -Woverflow false alarm in code unreachable after __builtin_mul_overflow
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Dec 18 01:28:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Yes, the example in footnote is valid because the left operand of the OR
expression is a constant expression with a non-zero value and so the right
operand is not evaluated (even at translation time).
__builtin_mul_overflow, OTOH, is not a constant expression, and so the
multiplication expression may be evaluated (and is allowed to be evaluated at
compile time) and the warning is, IMO, justified.
More information about the Gcc-bugs
mailing list