[Bug c/49706] New: No warning for (!x > 1) which is always false

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 11 22:34:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706

           Summary: No warning for (!x > 1) which is always false
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pinskia@gcc.gnu.org


Found this while looking into PR49474:
/* { dg-options "-Wextra -Wall" } */
void warn (void);
int f(int a)
{
  if (!a > 1) /* { dg-warning "false" } */
    warn();
  return 0;
}



More information about the Gcc-bugs mailing list