[compiler-rt] d412f35 - [asan/mac] Fix a -Wformat warning

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 17 06:18:13 PST 2021


Author: Nico Weber
Date: 2021-12-17T09:17:52-05:00
New Revision: d412f35395be8568261e318a0748ceb3731d69e6

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

LOG: [asan/mac] Fix a -Wformat warning

internal_getpid() is manually cast to int in all other places that
pass its result to a printf string, so do that here too for now.

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
index 28992bb028544..a916a03234fe9 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
@@ -68,7 +68,7 @@ class AtosSymbolizerProcess final : public SymbolizerProcess {
   bool StartSymbolizerSubprocess() override {
     // Put the string command line argument in the object so that it outlives
     // the call to GetArgV.
-    internal_snprintf(pid_str_, sizeof(pid_str_), "%d", internal_getpid());
+    internal_snprintf(pid_str_, sizeof(pid_str_), "%d", (int)internal_getpid());
 
     // Configure sandbox before starting atos process.
     return SymbolizerProcess::StartSymbolizerSubprocess();


        


More information about the llvm-commits mailing list