[Bug c++/19437] wrong warning when assigning negative value to int

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Jan 14 14:31:00 GMT 2005


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



More information about the Gcc-bugs mailing list