[Bug c/102661] signed integer overflow not detected in comparison since gcc-8
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Oct 9 10:04:48 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102661
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Signed integer overflow is undefined. You need to either use -fwrapv which
defines it as wrapping or you need to use unsigned typea to do the arithmetical
operations or you need to do the overflow detection differently.
More information about the Gcc-bugs
mailing list