]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3451] Add check for Wdeprecate-literal-operator
authorAndrei Pavel <andrei@isc.org>
Sun, 26 Oct 2025 17:13:53 +0000 (19:13 +0200)
committerAndrei Pavel <andrei@isc.org>
Sun, 26 Oct 2025 17:13:53 +0000 (19:13 +0200)
config.h.in
meson.build
src/bin/netconf/netconf.h
src/lib/yang/translator.h

index 42ccf28f3ebd0ac3ddaeeb048ae48a35ac6d7436..9d086c128f2fa467f84e9f3e38cc22b1539a4d67 100644 (file)
 /* Version number of package */
 #mesondefine VERSION
 
+/* Whether the compiler supports flag -Wdeprecated-literal-operator */
+#mesondefine WDEPRECATED_LITERAL_OPERATOR_FLAG_SUPPORTED
+
 /* Compile with Botan crypto */
 #mesondefine WITH_BOTAN
 
index 76f6d88ddc8cd636daab6bd722f2cb60251ed754..4bdc55152275dc7a317a495352a8738dd44764bb 100644 (file)
@@ -691,6 +691,9 @@ if cxx_id == 'clang' and cpp_args_opt.length() == 0
     compile_args += '-Qunused-arguments'
     no_warnings += ['-Wno-unused-variable', '-Wno-unused-parameter']
 endif
+if cpp.has_argument('-Wdeprecated-literal-operator')
+    conf_data.set('WDEPRECATED_LITERAL_OPERATOR_FLAG_SUPPORTED', 'yes')
+endif
 if werror_opt
     warnings += no_warnings
 endif
index 56eb5db6c90c155f3ff8c8cac0fdce066e856d77..0da3a61e592524ad9e8f05e2cb01b22ecfd31b90 100644 (file)
 
 #include <map>
 
-#ifdef __GNUC__
+#ifdef WDEPRECATED_LITERAL_OPERATOR_FLAG_SUPPORTED
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-literal-operator"
 #endif
 // #include <sysrepo-cpp/Changes.hpp>  // Will be required on newer sysrepo-cpp
 #include <sysrepo-cpp/Session.hpp>
 // #include <sysrepo-cpp/Subscription.hpp>  // Will be required on newer sysrepo-cpp
-#ifdef __GNUC__
+#ifdef WDEPRECATED_LITERAL_OPERATOR_FLAG_SUPPORTED
 #pragma GCC diagnostic pop
 #endif
 
index 8bd22112d9ce86b23d12ffa54b8db13d763a469e..137c65e78cb5e7ffec851df5a82f6951f1b6136f 100644 (file)
 #include <cc/data.h>
 #include <yang/netconf_error.h>
 
-#ifdef __GNUC__
+#ifdef WDEPRECATED_LITERAL_OPERATOR_FLAG_SUPPORTED
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-literal-operator"
 #endif
 #include <sysrepo-cpp/Connection.hpp>
 #include <sysrepo-cpp/Enum.hpp>
 #include <sysrepo-cpp/Session.hpp>
-#ifdef __GNUC__
+#ifdef WDEPRECATED_LITERAL_OPERATOR_FLAG_SUPPORTED
 #pragma GCC diagnostic pop
 #endif