[Bug c++/70495] false warning: comparison between signed and unsigned integer expressions

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Apr 1 12:21:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70495

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to András from comment #3)
> > b+b has type int
> Note: this does not give the warning. You can see the linked example for
> more details.

I know, but b+b+b adds b to an int and still produces an int, which is
obviously enough to confuse the compiler. I'm not saying it's not a bug, just
explaining where the signed value comes from.


More information about the Gcc-bugs mailing list