From b08d5f4b84d8b2a13eb0c0c42b03a902e5a3ec72 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 3 Jul 2018 11:59:53 +0200 Subject: [PATCH] LuaWrapper: Disable maybe uninitialized warnings with boost optional GCC enables `-Wmaybe-uninitialized` by default with `-Wall`, and it reports what looks like false positives with boost::optional types See: - https://svn.boost.org/trac10/ticket/12513 - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78044 --- ext/luawrapper/include/LuaContext.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp index fd22605c48..a98671c47d 100644 --- a/ext/luawrapper/include/LuaContext.hpp +++ b/ext/luawrapper/include/LuaContext.hpp @@ -78,6 +78,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * your function to std::function (not directly std::bind or a lambda function) so the class can detect which argument types * it wants. These arguments may only be of basic types (int, float, etc.) or std::string. */ + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + class LuaContext { struct ValueInRegistry; template struct Binder; @@ -2947,4 +2953,8 @@ struct LuaContext::Reader, } }; +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + #endif -- 2.47.2