This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82924] gcc gives no warning for comparing unsigned integer < 0 even with -Wextra enabled
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Nov 2017 20:45:15 +0000
- Subject: [Bug c++/82924] gcc gives no warning for comparing unsigned integer < 0 even with -Wextra enabled
- Auto-submitted: auto-generated
- References: <bug-82924-4@http.gcc.gnu.org/bugzilla/>
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.