[Bug c/77965] -Wduplicated-cond should find duplicated condition / identical expressions of form "a || a" or "a && a"

2016-10-26 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77965

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||mpolacek at gcc dot gnu.org
 Resolution|--- |WORKSFORME

--- Comment #2 from Marek Polacek  ---
.

[Bug c/77965] -Wduplicated-cond should find duplicated condition / identical expressions of form "a || a" or "a && a"

2016-10-14 Thread egall at gwmail dot gwu.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77965

Eric Gallager  changed:

   What|Removed |Added

 CC||egall at gwmail dot gwu.edu

--- Comment #1 from Eric Gallager  ---
Use -Wlogical-op:

$ /usr/local/bin/gcc -c -Wall -Wextra -pedantic -Wlogical-op -Wduplicated-cond
-Wtautological-compare logical_op.c 
logical_op.c: In function ‘foo’:
logical_op.c:5:17: warning: logical ‘or’ of equal expressions [-Wlogical-op]
  return (x == 5 || x == 5) ? 1 : 0;
 ^~