[Bug c/71345] New: Warn about redundant conditions

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon May 30 13:14:00 GMT 2016


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

            Bug ID: 71345
           Summary: Warn about redundant conditions
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

Perhaps we could/should warn for

int
foo (char c)
{
  if (c != '\0' && c == 'f')
    return 50; 
  return 5;
}

Here, the first condition seems redundant.


More information about the Gcc-bugs mailing list