|
Joined: Mar 2015
Posts: 64 Likes: 1
Member
|
OP
Member
Joined: Mar 2015
Posts: 64 Likes: 1 |
Hi, I'm trying to compile 62c35fe3cec from GH but I get this error: GCC 10 detected Compiling src/frontend/mame/luaengine_debug.cpp... In file included from ../../../../../src/frontend/mame/luaengine.h:29, from ../../../../../src/frontend/mame/luaengine.ipp:13, from ../../../../../src/frontend/mame/luaengine_debug.cpp:12: ../../../../../3rdparty/sol2/sol/sol.hpp: In static member function 'static _Res std::_Function_handler<_Res(_ArgTypes ...), _Functor>::_M_invoke(const std::_Any_data&, _ArgTypes&& ...) [with _Res = long unsigned int; _Functor = lua_engine::symbol_table_wrapper::add(const char*, sol::protected_function, std::optional<sol::basic_protected_function<sol::basic_reference<false>, false, sol::basic_reference<false> > >, std::optional<const char*>)::<lambda()>; _ArgTypes = {}]': ../../../../../3rdparty/sol2/sol/sol.hpp:15823:17: error: '<anonymous>' may be used uninitialized in this function [-Werror=maybe-uninitialized] 15823 | return UT(); | ^ ../../../../../3rdparty/sol2/sol/sol.hpp: In static member function 'static _Res std::_Function_handler<_Res(_ArgTypes ...), _Functor>::_M_invoke(const std::_Any_data&, _ArgTypes&& ...) [with _Res = long unsigned int; _Functor = lua_engine::initialize_debug(sol::table&)::<lambda(lua_engine::symbol_table_wrapper&, sol::this_state, const char*, int, int, sol::protected_function)>::<lambda(int, const u64*)>; _ArgTypes = {int, const long unsigned int*}]': ../../../../../3rdparty/sol2/sol/sol.hpp:15823:17: error: '<anonymous>' may be used uninitialized in this function [-Werror=maybe-uninitialized] 15823 | return UT(); | ^ cc1plus: all warnings being treated as errors make[2]: *** [frontend.make:754: ../../../../linux_gcc/obj/x64/Release/src/frontend/mame/luaengine_debug.o] Error 1 make[2]: Target 'all' not remade because of errors. make[1]: *** [Makefile:100: frontend] Error 2 make[1]: Target 'all' not remade because of errors. make: *** [makefile:1280: linux_x64] Error 2 make: Target 'all' not remade because of errors. Any idea? I've added a few changes of mine to 62c35fe3cec commit but they aren't even remotely near Lua machinery. Thanks. --F.Ulivi
|
|
|
|
Joined: Feb 2004
Posts: 2,369 Likes: 89
Very Senior Member
|
Very Senior Member
Joined: Feb 2004
Posts: 2,369 Likes: 89 |
What exact compiler and C++ standard library version are you using? I’ve seen that error with older versions of GCC, and we get around it by adding "-flifetime-dse=1" to the compile options for GCC 9 and earlier. Are you using GCC 10 with GNU libstdc++ 9 or earlier or something?
|
|
|
|
Joined: Feb 2004
Posts: 2,369 Likes: 89
Very Senior Member
|
Very Senior Member
Joined: Feb 2004
Posts: 2,369 Likes: 89 |
|
|
|
|
Joined: Mar 2015
Posts: 64 Likes: 1
Member
|
OP
Member
Joined: Mar 2015
Posts: 64 Likes: 1 |
Yes, my compiler version is exactly the one described in issue 9818 (i.e. 10.2.1 as distributed in stock Debian 11). Anyway, the -Wno-error=maybe-uninitialized flag fixes compilation for now, I think I can settle with this. Thanks. --F.Ulivi
|
|
|
|
Joined: Feb 2004
Posts: 2,369 Likes: 89
Very Senior Member
|
Very Senior Member
Joined: Feb 2004
Posts: 2,369 Likes: 89 |
You haven’t answered the other half of the question – what version of GNU libstdc++ are you compiling against (assuming you’re using GNU libstdc++ and not some other C++ standard library)?
|
|
|
|
Joined: Mar 2015
Posts: 64 Likes: 1
Member
|
OP
Member
Joined: Mar 2015
Posts: 64 Likes: 1 |
Assuming I'm reading the right thing I see the package version as follows: libstdc++6:amd64 10.2.1-6 amd64 GNU Standard C++ Library v3
|
|
|
|
Joined: Feb 2004
Posts: 2,369 Likes: 89
Very Senior Member
|
Very Senior Member
Joined: Feb 2004
Posts: 2,369 Likes: 89 |
OK, it seems that the error actually happens with GCC or GNU libstdc++ all the way up to 10.2 but not from 10.3 onwards. Probably best to just put “-flifetime-dse=1” in your compile options for now.
|
|
|
|
Joined: Mar 2015
Posts: 64 Likes: 1
Member
|
OP
Member
Joined: Mar 2015
Posts: 64 Likes: 1 |
Thank you! I'll go for it then. --F.Ulivi
|
|
|
1 members (box),
20
guests, and
2
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
Forums9
Topics9,088
Posts119,102
Members5,014
|
Most Online890 Jan 17th, 2020
|
|
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!
|
|
|
|