[compiler-rt] [sanitizer] Add missing bitcast to sanitizer_bitvector_test.cpp (PR #192090)
Thurston Dang via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 14 10:19:27 PDT 2026
https://github.com/thurstond created https://github.com/llvm/llvm-project/pull/192090
Fixes buildbot report
(https://lab.llvm.org/buildbot/#/builders/66/builds/29379):
/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp:64:29: error: format specifies type 'unsigned long' but the argument has type 'uptr' (aka 'unsigned int') [-Werror,-Wformat]
64 | fprintf(stderr, "%lu ", idx);
| ~~~ ^~~
| %u
>From d3ea0bd851c434133bcff95e9efd2efdf0b196fd Mon Sep 17 00:00:00 2001
From: Thurston Dang <thurston at google.com>
Date: Tue, 14 Apr 2026 17:18:08 +0000
Subject: [PATCH] [sanitizer] Add missing bitcast
Fixes buildbot report
(https://lab.llvm.org/buildbot/#/builders/66/builds/29379):
/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp:64:29: error: format specifies type 'unsigned long' but the argument has type 'uptr' (aka 'unsigned int') [-Werror,-Wformat]
64 | fprintf(stderr, "%lu ", idx);
| ~~~ ^~~
| %u
---
.../lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp
index 9f51d0cb0c68e..dc22dfd59fd90 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp
@@ -61,7 +61,7 @@ void Print(const BV &bv) {
t.copyFrom(bv);
while (!t.empty()) {
uptr idx = t.getAndClearFirstOne();
- fprintf(stderr, "%lu ", idx);
+ fprintf(stderr, "%lu ", (unsigned long)idx);
}
fprintf(stderr, "\n");
}
More information about the llvm-commits
mailing list