[Bug c/71345] Warn about redundant conditions

egallager at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Dec 12 04:29:56 GMT 2021


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

--- Comment #3 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #2)
> A simpler case would be:
> 
> int foo(int a, int b, int c)
> {
>     if(b == c && b == c) return 1; /* warns with -Wlogical-op */
>     if(a && b == c && b == c) return 2; /* missing warning */
>     return 0;
> }

So, if the first one goes under -Wlogical-op, I take it that if a warning for
the second one were added, it's go under that same flag?


More information about the Gcc-bugs mailing list