This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]