[LLVMbugs] [Bug 13540] New: clang should warn on comparing bools to integer constants

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 6 15:39:58 PDT 2012


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

             Bug #: 13540
           Summary: clang should warn on comparing bools to integer
                    constants
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


eg on this:

bool f(bool b) {
  return b == 48;
}


use case: I had

   if (a == 4)

somewhere, then i moved that into a variable cond, and incompletely replaced my
condition with that like so:

  if (cond == 4)

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