This is an archive of the discontinued LLVM Phabricator instance.

[lldb/lua] Suppress warnings about C-linkage in generated wrapper
Needs RevisionPublic

Authored by dim on Dec 3 2021, 12:46 PM.

Details

Summary

When lldb Lua bindings are enabled, the generated LLDBWrapLua.cpp file
generates a compiler warning about C-linkage:

lldb/LLDBWrapLua.cpp:71170:1: warning: 'LLDBSwigLuaBreakpointCallbackFunction' has C-linkage specified, but returns incomplete type 'llvm::Expected<bool>' which could be incompatible with C

In lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp these warnings
are suppressed using a few pragmas. Also Add these to lua-wrapper.swig
so they end up in LLDBWrapLua.cpp, making the warnings disappear.

Diff Detail

Event Timeline

dim requested review of this revision.Dec 3 2021, 12:46 PM
dim created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 3 2021, 12:46 PM
JDevlieghere requested changes to this revision.Dec 3 2021, 1:22 PM

We should move this from the wrapper to the header block, similar to what Pavel did for Python: https://reviews.llvm.org/rG9a14adeae00015798843ff5cad987e5fdbdddb34

This revision now requires changes to proceed.Dec 3 2021, 1:22 PM
dim added a comment.Dec 4 2021, 1:16 PM

We should move this from the wrapper to the header block, similar to what Pavel did for Python: https://reviews.llvm.org/rG9a14adeae00015798843ff5cad987e5fdbdddb34

I agree, but I'm not really qualified to do this. I just wanted to get rid of the warning. :)

labath added a subscriber: labath.Dec 6 2021, 6:00 AM

I just went ahead and did that in a52af6d3714.