From ea30ec72f44ca373ceafbe9eab4c2897da0329c9 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 3 Apr 2022 14:34:38 +1000 Subject: Disable lifetime dead store elimination for Linux GCC builds. This will hopefully work around the very unhelpful uninitialised variable warning that seems to be triggered by using Sol's get function with std::optional or sol::optional on Linux. --- scripts/genie.lua | 7 ++++++- src/frontend/mame/luaengine_debug.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index 012d65d8302..0c0f8fb5f27 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -93,6 +93,11 @@ function addprojectflags() buildoptions_cpp { "-Wsuggest-override", } + configuration { "linux-*" } + buildoptions_cpp { + "-flifetime-dse=1", -- GCC for Linux takes issue with Sol's get >() otherwise + } + configuration {} end end @@ -1217,7 +1222,7 @@ configuration { "android-arm64" } "-Wno-asm-operand-widths", } -configuration { "linux-*"} +configuration { "linux-*" } links { "dl", "rt", diff --git a/src/frontend/mame/luaengine_debug.cpp b/src/frontend/mame/luaengine_debug.cpp index b8bdbd482a8..9e7521a0f2a 100644 --- a/src/frontend/mame/luaengine_debug.cpp +++ b/src/frontend/mame/luaengine_debug.cpp @@ -123,7 +123,7 @@ public: }, std::move(setfun), (format && *format) ? *format : ""); - }; + } symbol_entry *find(char const *name) const { return m_table.find(name); } symbol_entry *find_deep(char const *name) { return m_table.find_deep(name); } -- cgit v1.2.3