[Bug c++/47729] Failure to receive warning message when comparing signed and unsigned integers

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 14 17:16:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47729

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-14 17:09:24 UTC ---
(In reply to comment #2)
> > The relevant comment in the source code of the compiler is:
> > 
> >       /* Do not warn if the comparison is an equality operation, the
                                                 ^^^^^^^^^^^^^^^^^^
> >          unsigned quantity is an integral constant, and it would fit
> >          in the result if the result were signed.  */
> 
> Good point, I was thinking the same; however thought that condition would also
> hold true for >, <, >=, <=...

Those are relational operators, not equality operators



More information about the Gcc-bugs mailing list