This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/51712] -Wtype-limits should not trigger for types of implementation-defined signedness
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 17 Apr 2012 21:27:25 +0000
- Subject: [Bug c/51712] -Wtype-limits should not trigger for types of implementation-defined signedness
- Auto-submitted: auto-generated
- References: <bug-51712-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51712
--- Comment #5 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-04-17 21:27:25 UTC ---
(In reply to comment #4)
> I am not convinced clang's heuristic is the right one. For example, the
> following code trips clang's warning, but the test is still not redundant. The
I can see that it doesn't handle this case, but it does handle two other common
cases we don't want to warn about, namely, arg >= FOO and when the zero comes
from a macro expansion.
In any case, at the moment of the warning, GCC doesn't know that arg is an
enum, and avoid warning. But perhaps this case is easier to fix than the one
above.