This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20019] incorrect overflow warning
- From: "neil at daikokuya dot co dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Feb 2005 14:00:47 -0000
- Subject: [Bug c++/20019] incorrect overflow warning
- References: <20050217025913.20019.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From neil at daikokuya dot co dot uk 2005-02-17 14:00 -------
Subject: Re: incorrect overflow warning
schlie at comcast dot net wrote:-
>
> ------- Additional Comments From schlie at comcast dot net 2005-02-17 13:20 -------
> (In reply to comment #6)
> > What should get a warning is the assignment of 0x80 to a char.
>
> Not that either, as although the two differ in sign, the value does not exceed the type's precision.
I disagree. Like so:
"/tmp/foo.c", line 1: warning: value changes sign during integer type
conversion
char x = 0x80;
^
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20019