[#3451] Add check for Wdeprecate-literal-operator
Some checks failed
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled

This commit is contained in:
Andrei Pavel
2025-10-26 19:13:53 +02:00
parent e1be99120e
commit f7c1900876
4 changed files with 10 additions and 4 deletions

View File

@@ -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

View 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

View File

@@ -17,14 +17,14 @@
#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

View File

@@ -10,14 +10,14 @@
#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