This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19437] wrong warning when assigning negative value to int
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jan 2005 14:30:59 -0000
- Subject: [Bug c++/19437] wrong warning when assigning negative value to int
- References: <20050114093847.19437.oliverst@online.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-14 14:30 -------
int val = i ? i : -1;
we convert it to unsigned because it gets promoted to unsigned because i is unsigned and then there is
an implicit cast to int. so the type of "i ? i : -1" is unsigned and there is an implicit cast to int.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19437