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.

Reply via email to