[LLVMbugs] [Bug 19125] New: -Wconstant-logical-operand false positive when using "if (... || 0)" or "if (... || 1)"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 13 03:36:37 PDT 2014


            Bug ID: 19125
           Summary: -Wconstant-logical-operand false positive when using
                    "if (... || 0)" or "if (... || 1)"
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: timurrrr at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

 46   if (value ||
 48       shadow_end - shadow_beg <
common_flags()->clear_shadow_mmap_threshold) {
where SANITIZER_WINDOWS is "# define SANITIZER_WINDOWS 0" on Linux
  COMPILE:   clang_linux/asan-i386/i386:
In file included from
error: use of logical '||' with constant operand
  if (value ||
note: use '|' for a bitwise operation
  if (value ||

I believe this is a false positive -Wconstant-logical-operand.

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/20140313/3f001c71/attachment.html>

More information about the llvm-bugs mailing list