[clang] [clang] Add -Wbool-integral-comparison (PR #194180)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 27 09:58:15 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 54220 tests passed
* 969 tests skipped

All executed tests passed, but another part of the build **failed**. Click on a failure below to see the details.

<details>
<summary>compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan-x86_64.dir/tsan_rtl_report.cpp.o</summary>

```
FAILED: compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan-x86_64.dir/tsan_rtl_report.cpp.o
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/../.. -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -Wall -Werror -Wno-unused-parameter -O3 -DNDEBUG -std=c++17 -m64 -fno-lto -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -ftrivial-auto-var-init=pattern -nostdinc++ -fPIE -fno-rtti -msse4.2 -Wframe-larger-than=530 -Wglobal-constructors -MD -MT compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan-x86_64.dir/tsan_rtl_report.cpp.o -MF compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan-x86_64.dir/tsan_rtl_report.cpp.o.d -o compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan-x86_64.dir/tsan_rtl_report.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:562:51: error: comparison between 'bool' and integral type 'u64' (aka 'unsigned long long') is suspicious; the 'bool' operand is converted to an integral value that can only be 0 or 1 [-Werror,-Wbool-integral-comparison]
562 |               is_read == ev->is_read && is_atomic == ev->is_atomic && !is_free)
|                                         ~~~~~~~~~ ^  ~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:562:23: error: comparison between 'bool' and integral type 'u64' (aka 'unsigned long long') is suspicious; the 'bool' operand is converted to an integral value that can only be 0 or 1 [-Werror,-Wbool-integral-comparison]
562 |               is_read == ev->is_read && is_atomic == ev->is_atomic && !is_free)
|               ~~~~~~~ ^  ~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:591:53: error: comparison between 'bool' and integral type 'u64' (aka 'unsigned long long') is suspicious; the 'bool' operand is converted to an integral value that can only be 0 or 1 [-Werror,-Wbool-integral-comparison]
591 |                 is_read == ev->is_read && is_atomic == ev->is_atomic &&
|                                           ~~~~~~~~~ ^  ~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:591:25: error: comparison between 'bool' and integral type 'u64' (aka 'unsigned long long') is suspicious; the 'bool' operand is converted to an integral value that can only be 0 or 1 [-Werror,-Wbool-integral-comparison]
591 |                 is_read == ev->is_read && is_atomic == ev->is_atomic &&
|                 ~~~~~~~ ^  ~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:607:65: error: comparison between 'bool' and integral type 'u64' (aka 'unsigned long long') is suspicious; the 'bool' operand is converted to an integral value that can only be 0 or 1 [-Werror,-Wbool-integral-comparison]
607 |                 is_read == ev->is_read && !is_atomic && is_free == ev->is_free)
|                                                         ~~~~~~~ ^  ~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:607:25: error: comparison between 'bool' and integral type 'u64' (aka 'unsigned long long') is suspicious; the 'bool' operand is converted to an integral value that can only be 0 or 1 [-Werror,-Wbool-integral-comparison]
607 |                 is_read == ev->is_read && !is_atomic && is_free == ev->is_free)
|                 ~~~~~~~ ^  ~~~~~~~~~~~
6 errors generated.
```
</details>
<details>
<summary>compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan-dynamic-x86_64.dir/tsan_rtl_report.cpp.o</summary>

```
FAILED: compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan-dynamic-x86_64.dir/tsan_rtl_report.cpp.o
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -DCOMPILER_RT_SHARED_LIB -DSANITIZER_SHARED -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Dclang_rt_tsan_dynamic_x86_64_EXPORTS -I/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/../.. -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -Wall -Werror -Wno-unused-parameter -O3 -DNDEBUG -std=c++17 -fPIC -m64 -fno-lto -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -ftrivial-auto-var-init=pattern -nostdinc++ -fno-rtti -msse4.2 -Wframe-larger-than=530 -Wglobal-constructors -MD -MT compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan-dynamic-x86_64.dir/tsan_rtl_report.cpp.o -MF compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan-dynamic-x86_64.dir/tsan_rtl_report.cpp.o.d -o compiler-rt/lib/tsan/rtl/CMakeFiles/clang_rt.tsan-dynamic-x86_64.dir/tsan_rtl_report.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:562:51: error: comparison between 'bool' and integral type 'u64' (aka 'unsigned long long') is suspicious; the 'bool' operand is converted to an integral value that can only be 0 or 1 [-Werror,-Wbool-integral-comparison]
562 |               is_read == ev->is_read && is_atomic == ev->is_atomic && !is_free)
|                                         ~~~~~~~~~ ^  ~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:562:23: error: comparison between 'bool' and integral type 'u64' (aka 'unsigned long long') is suspicious; the 'bool' operand is converted to an integral value that can only be 0 or 1 [-Werror,-Wbool-integral-comparison]
562 |               is_read == ev->is_read && is_atomic == ev->is_atomic && !is_free)
|               ~~~~~~~ ^  ~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:591:53: error: comparison between 'bool' and integral type 'u64' (aka 'unsigned long long') is suspicious; the 'bool' operand is converted to an integral value that can only be 0 or 1 [-Werror,-Wbool-integral-comparison]
591 |                 is_read == ev->is_read && is_atomic == ev->is_atomic &&
|                                           ~~~~~~~~~ ^  ~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:591:25: error: comparison between 'bool' and integral type 'u64' (aka 'unsigned long long') is suspicious; the 'bool' operand is converted to an integral value that can only be 0 or 1 [-Werror,-Wbool-integral-comparison]
591 |                 is_read == ev->is_read && is_atomic == ev->is_atomic &&
|                 ~~~~~~~ ^  ~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:607:65: error: comparison between 'bool' and integral type 'u64' (aka 'unsigned long long') is suspicious; the 'bool' operand is converted to an integral value that can only be 0 or 1 [-Werror,-Wbool-integral-comparison]
607 |                 is_read == ev->is_read && !is_atomic && is_free == ev->is_free)
|                                                         ~~~~~~~ ^  ~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp:607:25: error: comparison between 'bool' and integral type 'u64' (aka 'unsigned long long') is suspicious; the 'bool' operand is converted to an integral value that can only be 0 or 1 [-Werror,-Wbool-integral-comparison]
607 |                 is_read == ev->is_read && !is_atomic && is_free == ev->is_free)
|                 ~~~~~~~ ^  ~~~~~~~~~~~
6 errors generated.
```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/194180


More information about the cfe-commits mailing list