Bug ID: 81783
           Summary: -Wtautological-compare could do better
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot
          Reporter: sirl at gcc dot
  Target Milestone: ---

This example code doesn't warn with -Wtautological-compare:

int f(int a)
        if ((a & 0x10) == 10)
                return 1;
        return 0;

clang warns like this:
Wtautological-compare-1.c:5:17: warning: bitwise comparison always evaluates to
false [-Wtautological-compare]
        if ((a & 0x10) == 10)

Reply via email to