[Bug c/51712] -Wtype-limits should not trigger for types of implementation-defined signedness

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 17 22:10:00 GMT 2012


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.



More information about the Gcc-bugs mailing list