From 71d127ac1d64d433807843afeb2cdbb3e9a3da68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Svensson?= Date: Tue, 19 Dec 2023 17:31:06 +0100 Subject: [PATCH 1/2] Build support for gcc-11, gcc-12 and gcc-13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handle build warning errors by disabling some warnings found by the new compiler versions. Signed-off-by: Björn Svensson --- linux/ws_main.py | 3 +++ linux_dpdk/ws_main.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/linux/ws_main.py b/linux/ws_main.py index 3b1d91180a..fd86271920 100755 --- a/linux/ws_main.py +++ b/linux/ws_main.py @@ -528,6 +528,9 @@ def configure_sanitized (conf): #'-DGLIBCXX_USE_CXX11_ABI=0', '-g', '-Wno-deprecated-declarations', + '-Wno-dangling-pointer', # Disabled since unrecognized before gcc-12 + '-Wno-error=maybe-uninitialized', # Additional warnings in gcc-11 + '-Wno-error=overloaded-virtual', # Additional warnings in gcc-13 '-Wno-error=uninitialized', '-std=c++0x', '-Wno-sign-compare', diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py index 625ce6c2e0..e46f4b8fae 100644 --- a/linux_dpdk/ws_main.py +++ b/linux_dpdk/ws_main.py @@ -57,6 +57,8 @@ gcc_flags = ['-Wall', '-Werror', + '-Wno-error=maybe-uninitialized', # Additional warnings in gcc-11 + '-Wno-dangling-pointer', # Disabled since unrecognized before gcc-12 '-Wno-literal-suffix', '-Wno-sign-compare', '-Wno-strict-aliasing', From 3cc26aa8f4a79111642cbfd71fffcb73c442f5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Svensson?= Date: Tue, 19 Dec 2023 23:27:44 +0100 Subject: [PATCH 2/2] Fix overloaded-virtual warning in gcc-13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Björn Svensson --- linux/ws_main.py | 1 - src/publisher/trex_publisher.h | 3 ++- src/sim/trex_sim_stateless.cpp | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/linux/ws_main.py b/linux/ws_main.py index fd86271920..bc6cfe664e 100755 --- a/linux/ws_main.py +++ b/linux/ws_main.py @@ -530,7 +530,6 @@ def configure_sanitized (conf): '-Wno-deprecated-declarations', '-Wno-dangling-pointer', # Disabled since unrecognized before gcc-12 '-Wno-error=maybe-uninitialized', # Additional warnings in gcc-11 - '-Wno-error=overloaded-virtual', # Additional warnings in gcc-13 '-Wno-error=uninitialized', '-std=c++0x', '-Wno-sign-compare', diff --git a/src/publisher/trex_publisher.h b/src/publisher/trex_publisher.h index 45c3255bce..84cde0ff61 100644 --- a/src/publisher/trex_publisher.h +++ b/src/publisher/trex_publisher.h @@ -137,7 +137,8 @@ class TrexPublisher { bool m_is_interactive; std::vector m_ctxs; - + +protected: static const int MSG_COMPRESS_THRESHOLD = 256; }; diff --git a/src/sim/trex_sim_stateless.cpp b/src/sim/trex_sim_stateless.cpp index f51f522b86..67da743b37 100644 --- a/src/sim/trex_sim_stateless.cpp +++ b/src/sim/trex_sim_stateless.cpp @@ -107,15 +107,14 @@ class SimPublisher : public TrexPublisher { public: /* override create */ - bool Create(uint16_t port, bool disable) { + bool Create(uint16_t port, bool disable) override { return true; } - void Delete() { - + void Delete(int timeout_sec = 0) override { } - void publish_json(const std::string &s) { + void publish_json(const std::string &s, uint32_t zip_threshold = TrexPublisher::MSG_COMPRESS_THRESHOLD) override { } virtual ~SimPublisher() {