From 29c99fe8705a67659335be1e5181dce48bcf3be6 Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Mon, 6 Apr 2015 20:46:56 -0400 Subject: [PATCH] ignore "maybe uninitialized" warning in game lua kernel. This breaks compilation for gcc 4.9.2 with -O2, with an apparently spurious warning. --- src/scripting/game_lua_kernel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index 044be0c6dc48..f631bd405373 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -128,6 +128,11 @@ class CVideo; #include "scripting/debug_lua.hpp" #endif +// Suppress uninitialized variables warnings, because of boost::optional constructors in this file which apparently confuses gcc +#if defined(__GNUC__) && !defined(__clang__) // we shouldn't need this for clang, but for gcc and tdm-gcc we probably do +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + static lg::log_domain log_scripting_lua("scripting/lua"); #define LOG_LUA LOG_STREAM(info, log_scripting_lua) #define WRN_LUA LOG_STREAM(warn, log_scripting_lua)