[Lldb-commits] [lldb] fb01c01 - [LLDB][Python] warning fix for LLDBSwigPythonBreakpointCallbackFunction

Lawrence D'Anna via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 30 09:48:27 PDT 2019


Author: Lawrence D'Anna
Date: 2019-10-30T09:47:27-07:00
New Revision: fb01c01bf3f60d1d229126ea4088519adae5c015

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

LOG: [LLDB][Python] warning fix for LLDBSwigPythonBreakpointCallbackFunction

This is a quick followup to this commit:

https://reviews.llvm.org/rGa69bbe02a2352271e8b14542073f177e24c499c1

In that, I #pragma-squelch this warning in `ScriptInterpreterPython.cpp`
but we get the same warning in `PythonTestSuite.cpp`.

This patch squelches the same warning in the same way as the
reviweed commit.   I'm submitting it without review under the
"obviously correct" rule.

At least if this is incorrect the main commit was also incorrect.

By the way, as far as I can tell, these functions are extern "C" because
SWIG does that to everything, not because they particularly need to be.

Added: 
    

Modified: 
    lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
index 2ac631eba424..12ffdfe79ec3 100644
--- a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
+++ b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
@@ -59,6 +59,9 @@ extern "C" void init_lldb(void) {}
 #define LLDBSwigPyInit init_lldb
 #endif
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
+
 extern "C" llvm::Expected<bool> LLDBSwigPythonBreakpointCallbackFunction(
     const char *python_function_name, const char *session_dictionary_name,
     const lldb::StackFrameSP &sb_frame,
@@ -67,6 +70,8 @@ extern "C" llvm::Expected<bool> LLDBSwigPythonBreakpointCallbackFunction(
   return false;
 }
 
+#pragma clang diagnostic pop
+
 extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(
     const char *python_function_name, const char *session_dictionary_name,
     const lldb::StackFrameSP &sb_frame, const lldb::WatchpointSP &sb_wp) {


        


More information about the lldb-commits mailing list