This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/71345] Warn about redundant conditions
- 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: Wed, 31 Aug 2016 18:46:59 +0000
- Subject: [Bug c/71345] Warn about redundant conditions
- Auto-submitted: auto-generated
- References: <bug-71345-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71345
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
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;
}