[llvm-bugs] [Bug 33718] New: HexagonInstrInfo.cpp - enum constant in boolean context warning

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 8 05:33:16 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33718

            Bug ID: 33718
           Summary: HexagonInstrInfo.cpp - enum constant in boolean
                    context warning
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: Hexagon
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: kparzysz at codeaurora.org, llvm-bugs at lists.llvm.org,
                    sgundapa at codeaurora.org

gcc7.1 is complaining with this warning on 2 lines in HexagonInstrInfo.cpp:

llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp:1800:41: warning: enum constant in
boolean context [-Wint-in-bool-context]

  if (MO.getTargetFlags() && HexagonII::HMOTF_ConstExtended)
    return true;

llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp:1966:43: warning: enum constant in
boolean context [-Wint-in-bool-context]

    if (I->getTargetFlags() && HexagonII::HMOTF_ConstExtended)
      return true;

These almost certainly should be using & instead of &&

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170708/ba77fec1/attachment.html>


More information about the llvm-bugs mailing list