From: Andrei Pavel Date: Sun, 26 Oct 2025 17:13:53 +0000 (+0200) Subject: [#3451] Add check for Wdeprecate-literal-operator X-Git-Tag: Kea-3.1.3~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f7c1900876338784de3725c5a0510e86dbff0b07;p=thirdparty%2Fkea.git [#3451] Add check for Wdeprecate-literal-operator --- diff --git a/config.h.in b/config.h.in index 42ccf28f3e..9d086c128f 100644 --- a/config.h.in +++ b/config.h.in @@ -100,6 +100,9 @@ /* 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 diff --git a/meson.build b/meson.build index 76f6d88ddc..4bdc551522 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/src/bin/netconf/netconf.h b/src/bin/netconf/netconf.h index 56eb5db6c9..0da3a61e59 100644 --- a/src/bin/netconf/netconf.h +++ b/src/bin/netconf/netconf.h @@ -17,14 +17,14 @@ #include -#ifdef __GNUC__ +#ifdef WDEPRECATED_LITERAL_OPERATOR_FLAG_SUPPORTED #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-literal-operator" #endif // #include // Will be required on newer sysrepo-cpp #include // #include // Will be required on newer sysrepo-cpp -#ifdef __GNUC__ +#ifdef WDEPRECATED_LITERAL_OPERATOR_FLAG_SUPPORTED #pragma GCC diagnostic pop #endif diff --git a/src/lib/yang/translator.h b/src/lib/yang/translator.h index 8bd22112d9..137c65e78c 100644 --- a/src/lib/yang/translator.h +++ b/src/lib/yang/translator.h @@ -10,14 +10,14 @@ #include #include -#ifdef __GNUC__ +#ifdef WDEPRECATED_LITERAL_OPERATOR_FLAG_SUPPORTED #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-literal-operator" #endif #include #include #include -#ifdef __GNUC__ +#ifdef WDEPRECATED_LITERAL_OPERATOR_FLAG_SUPPORTED #pragma GCC diagnostic pop #endif