[llvm] 0963833 - [ExecutionEngine] Silence warnings about sprintf use in interpreter.
    Lang Hames via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Mar  1 15:39:28 PST 2023
    
    
  
Author: Lang Hames
Date: 2023-03-01T15:37:09-08:00
New Revision: 0963833a194331a8b8d6775dcd1c3025a8154751
URL: https://github.com/llvm/llvm-project/commit/0963833a194331a8b8d6775dcd1c3025a8154751
DIFF: https://github.com/llvm/llvm-project/commit/0963833a194331a8b8d6775dcd1c3025a8154751.diff
LOG: [ExecutionEngine] Silence warnings about sprintf use in interpreter.
We should review memory safety in the interpreter
(https://github.com/llvm/llvm-project/issues/58086), but for now just silence
the warnings to reduce noise.
rdar://100555195
Added: 
    
Modified: 
    llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
Removed: 
    
################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index 29f481a1e4e82..73b1023fffac1 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
@@ -344,6 +344,10 @@ static GenericValue lle_X_abort(FunctionType *FT, ArrayRef<GenericValue> Args) {
   return GenericValue();
 }
 
+// Silence warnings about sprintf. (See also
+// https://github.com/llvm/llvm-project/issues/58086)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
 // int sprintf(char *, const char *, ...) - a very rough implementation to make
 // output useful.
 static GenericValue lle_X_sprintf(FunctionType *FT,
@@ -425,6 +429,7 @@ static GenericValue lle_X_sprintf(FunctionType *FT,
   }
   return GV;
 }
+#pragma clang diagnostic pop
 
 // int printf(const char *, ...) - a very rough implementation to make output
 // useful.
        
    
    
More information about the llvm-commits
mailing list