http://llvm.org/bugs/show_bug.cgi?id=19125
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: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
lib/asan/asan_poisoning.h:
46 if (value ||
47 SANITIZER_WINDOWS ||
48 shadow_end - shadow_beg <
common_flags()->clear_shadow_mmap_threshold) {
where SANITIZER_WINDOWS is "# define SANITIZER_WINDOWS 0" on Linux
yields
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/15156/steps/compile/logs/stdio
COMPILE: clang_linux/asan-i386/i386:
/home/llvmbb/llvm-build-dir/clang-x86_64-debian-fast/llvm.src/projects/compiler-rt/lib/asan/asan_linux.cc
In file included from
/home/llvmbb/llvm-build-dir/clang-x86_64-debian-fast/llvm.src/projects/compiler-rt/lib/asan/asan_globals.cc:17:
/home/llvmbb/llvm-build-dir/clang-x86_64-debian-fast/llvm.src/projects/compiler-rt/lib/asan/asan_poisoning.h:46:13:
error: use of logical '||' with constant operand
[-Werror,-Wconstant-logical-operand]
if (value ||
^
/home/llvmbb/llvm-build-dir/clang-x86_64-debian-fast/llvm.src/projects/compiler-rt/lib/asan/asan_poisoning.h:46:13:
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs