------- 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:

> reg...@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

Reply via email to