From: Remi Gacogne Date: Tue, 3 Jul 2018 09:59:53 +0000 (+0200) Subject: LuaWrapper: Disable maybe uninitialized warnings with boost optional X-Git-Tag: dnsdist-1.3.1~3^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6769%2Fhead;p=thirdparty%2Fpdns.git 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 --- 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