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: [email protected]
ReportedBy: [email protected]
CC: [email protected]
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs