[LLVMbugs] [Bug 8879] New: -Wtype-limits not implemented

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jan 1 03:00:37 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=8879

           Summary: -Wtype-limits not implemented
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: tss at iki.fi
                CC: llvmbugs at cs.uiuc.edu


No warnings are given when comparing a type against impossible values.

Example:

int main(void) {
    unsigned short a = 0;
    if (a < 0) return 1;
    if (a > 65535) return 1;
    if (a == -1) return 1;
    return 0;
}

gcc warns:

test2.c:3: warning: comparison is always false due to limited range of data
type
test2.c:4: warning: comparison is always false due to limited range of data
type
test2.c:5: warning: comparison is always false due to limited range of data
type

clang doesn't warn anything.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list