]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
LuaWrapper: Disable maybe uninitialized warnings with boost optional 6769/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 3 Jul 2018 09:59:53 +0000 (11:59 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 3 Jul 2018 09:59:53 +0000 (11:59 +0200)
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

index fd22605c486ce383258bd8e9bfcd31337db24cd3..a98671c47dfaedba9899b7f69a92d51372612371 100644 (file)
@@ -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<typename TFunctionObject, typename TFirstParamType> struct Binder;
@@ -2947,4 +2953,8 @@ struct LuaContext::Reader<std::tuple<TFirst, TOthers...>,
     }
 };
 
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+
 #endif