[compiler-rt] 143f71e - [sanitizer_common] Fix type in format specifier by casting

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 11:17:10 PST 2024


Author: Thurston Dang
Date: 2024-01-25T19:17:02Z
New Revision: 143f71e03ac39b9b3ba3c757454b2c65800b61a3

URL: https://github.com/llvm/llvm-project/commit/143f71e03ac39b9b3ba3c757454b2c65800b61a3
DIFF: https://github.com/llvm/llvm-project/commit/143f71e03ac39b9b3ba3c757454b2c65800b61a3.diff

LOG: [sanitizer_common] Fix type in format specifier by casting

40dcf24522af91ab22af2e69f28d1f1d2a860f5c had changed the format
specifier to fix the build for their local system. Unfortunately,
that disagrees with some other systems, such as this buildbot:
https://lab.llvm.org/buildbot/#/builders/37/builds/30440

This patch fixes the issue for all systems by casting.

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp

Removed: 
    


################################################################################
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 670e96552c68f6d..9f51d0cb0c68e18 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp
@@ -71,7 +71,7 @@ void Print(const set<uptr> &s) {
 #if defined(_WIN64)
     fprintf(stderr, "%llu ", *it);
 #else
-    fprintf(stderr, "%lu ", *it);
+    fprintf(stderr, "%lu ", (unsigned long)*it);
 #endif
   }
   fprintf(stderr, "\n");


        


More information about the llvm-commits mailing list