kastiglione created this revision. kastiglione added a reviewer: JDevlieghere. kastiglione requested review of this revision. Herald added a project: LLDB. Herald added a subscriber: lldb-commits.
Ignore `-Wreturn-type-c-linkage` diagnostics for `LLDBSwigPythonBreakpointCallbackFunction`. The function is defined in `python-wrapper.swig` which uses `extern "C" { ... }` blocks. The declaration of this function in `ScriptInterpreterPython.cpp` already uses these same pragmas to silence the warning there. This prevents `-Werror` builds from failing. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D98368 Files: lldb/bindings/python/python-wrapper.swig Index: lldb/bindings/python/python-wrapper.swig =================================================================== --- lldb/bindings/python/python-wrapper.swig +++ lldb/bindings/python/python-wrapper.swig @@ -39,6 +39,17 @@ // This function is called by lldb_private::ScriptInterpreterPython::BreakpointCallbackFunction(...) // and is used when a script command is attached to a breakpoint for execution. +#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 + SWIGEXPORT llvm::Expected<bool> LLDBSwigPythonBreakpointCallbackFunction ( @@ -85,6 +96,12 @@ return result.get().get() != Py_False; } +#if _MSC_VER +#pragma warning (pop) +#endif + +#pragma clang diagnostic pop + // This function is called by lldb_private::ScriptInterpreterPython::WatchpointCallbackFunction(...) // and is used when a script command is attached to a watchpoint for execution.
Index: lldb/bindings/python/python-wrapper.swig =================================================================== --- lldb/bindings/python/python-wrapper.swig +++ lldb/bindings/python/python-wrapper.swig @@ -39,6 +39,17 @@ // This function is called by lldb_private::ScriptInterpreterPython::BreakpointCallbackFunction(...) // and is used when a script command is attached to a breakpoint for execution. +#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 + SWIGEXPORT llvm::Expected<bool> LLDBSwigPythonBreakpointCallbackFunction ( @@ -85,6 +96,12 @@ return result.get().get() != Py_False; } +#if _MSC_VER +#pragma warning (pop) +#endif + +#pragma clang diagnostic pop + // This function is called by lldb_private::ScriptInterpreterPython::WatchpointCallbackFunction(...) // and is used when a script command is attached to a watchpoint for execution.
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits