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++/82924] gcc gives no warning for comparing unsigned integer < 0 even with -Wextra enabled


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-11-10
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think that warning is simply disabled in templates, to avoid warnings about
(x < 0) which would depend on whether T is signed or unsigned, but is not a
helpful warning in general. In this case we know that (y < 0) is always an
unsigned type.

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