[Lldb-commits] [PATCH] D70830: [LLDB] Disable MSVC warning C4190

Alexandre Ganea via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 28 09:28:08 PST 2019


aganea created this revision.
aganea added reviewers: JDevlieghere, lawrence_danna.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Before this patch, when compiling with MSVC 15.9.17 (latest), we would see:

  F:\llvm-project\lldb\source\Plugins\ScriptInterpreter\Python\ScriptInterpreterPython.cpp(83): warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has C-linkage specified, but returns UDT 'llvm::Expected<bool>' which is incompatible with C


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70830

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


Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===================================================================
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -77,11 +77,23 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
 
+// Disable warning C4190: 'LLDBSwigPythonBreakpointCallbackFunction' has
+// C-linkage specified, but returns UDT 'llvm::Expected<bool>' which is
+// incompatible with C
+#if _MSC_VER
+#pragma warning (push)
+#pragma warning (disable : 4190)
+#endif
+
 extern "C" llvm::Expected<bool> LLDBSwigPythonBreakpointCallbackFunction(
     const char *python_function_name, const char *session_dictionary_name,
     const lldb::StackFrameSP &sb_frame,
     const lldb::BreakpointLocationSP &sb_bp_loc, StructuredDataImpl *args_impl);
 
+#if _MSC_VER
+#pragma warning (pop)
+#endif
+
 #pragma clang diagnostic pop
 
 extern "C" bool LLDBSwigPythonWatchpointCallbackFunction(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70830.231448.patch
Type: text/x-patch
Size: 1082 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191128/368bcebd/attachment-0001.bin>


More information about the lldb-commits mailing list