[Bug c/40390] possible integer wrong code bug
joseph at codesourcery dot com
gcc-bugzilla@gcc.gnu.org
Tue Jun 9 18:34:00 GMT 2009
------- Comment #1 from joseph at codesourcery dot com 2009-06-09 18:34 -------
Subject: Re: New: possible integer wrong code bug
On Tue, 9 Jun 2009, regehr at cs dot utah dot edu wrote:
> regehr@john-home:~$ cat foo.c
> #include <stdio.h>
>
> int foo(int y)
> {
> return (((unsigned short)y*(unsigned short)-2)>=(y?0:y));
This involves a signed integer overflow, 65534*65534. -Wstrict-overflow=3
warns you about this.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40390
More information about the Gcc-bugs
mailing list