Skip to content

Commit 1cc0ba4

Browse files
committed
[LLDB] Disable MSVC warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has C-linkage specified, but returns UDT 'llvm::Expected<bool>' which is incompatible with C
Differential Revision: https://reviews.llvm.org/D70830
1 parent 8bf31e2 commit 1cc0ba4

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,23 @@ extern "C" void init_lldb(void);
7777
#pragma clang diagnostic push
7878
#pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
7979

80+
// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
81+
// C-linkage specified, but returns UDT 'llvm::Expected<bool>' which is
82+
// incompatible with C
83+
#if _MSC_VER
84+
#pragma warning (push)
85+
#pragma warning (disable : 4190)
86+
#endif
87+
8088
extern "C" llvm::Expected<bool> LLDBSwigPythonBreakpointCallbackFunction(
8189
const char *python_function_name, const char *session_dictionary_name,
8290
const lldb::StackFrameSP &sb_frame,
8391
const lldb::BreakpointLocationSP &sb_bp_loc, StructuredDataImpl *args_impl);
8492

93+
#if _MSC_VER
94+
#pragma warning (pop)
95+
#endif
96+
8597
#pragma clang diagnostic pop
8698

8799
extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(

lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ extern "C" void init_lldb(void) {}
6262
#pragma clang diagnostic push
6363
#pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
6464

65+
// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
66+
// C-linkage specified, but returns UDT 'llvm::Expected<bool>' which is
67+
// incompatible with C
68+
#if _MSC_VER
69+
#pragma warning (push)
70+
#pragma warning (disable : 4190)
71+
#endif
72+
6573
extern "C" llvm::Expected<bool> LLDBSwigPythonBreakpointCallbackFunction(
6674
const char *python_function_name, const char *session_dictionary_name,
6775
const lldb::StackFrameSP &sb_frame,
@@ -70,6 +78,10 @@ extern "C" llvm::Expected<bool> LLDBSwigPythonBreakpointCallbackFunction(
7078
return false;
7179
}
7280

81+
#if _MSC_VER
82+
#pragma warning (pop)
83+
#endif
84+
7385
#pragma clang diagnostic pop
7486

7587
extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(

0 commit comments

Comments
 (0)