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

           Summary: "comparison of 0 > unsigned expression is always
                    false" is too trigger happy.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


When compiling the following program with -Wsign-compare I get the "comparison
of 0 > unsigned expression is always false" warning.
Gcc silently compiles it.

===
static const unsigned int kMax = 0;

int foo() {
  return (kMax > 0);
}
===

=== Warning:
foo.c:4:16: warning: comparison of 0 > unsigned expression is always false
[-Wsign-compare]
  return (kMax > 0);
          ~~~~ ^ ~
1 warning generated.
===

commandline used: clang++ -Wsign-compare -c foo.c

-- 
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

Reply via email to