From f8fdb5004e8db9fa6b95af928c6945a3de0ae9f0 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 8 Jun 2019 15:58:33 +0000 Subject: [PATCH 1/3] Fix GCC 9.1 build warnings /monero#5613 GCC wants operator= aand copy ctor to be both defined, or neither --- contrib/epee/include/net/net_utils_base.h | 5 +++++ src/device/device_ledger.cpp | 12 ++++++++++++ src/device/device_ledger.hpp | 1 + 3 files changed, 18 insertions(+) diff --git a/contrib/epee/include/net/net_utils_base.h b/contrib/epee/include/net/net_utils_base.h index a133942fb0..0132ae95a4 100644 --- a/contrib/epee/include/net/net_utils_base.h +++ b/contrib/epee/include/net/net_utils_base.h @@ -257,6 +257,11 @@ namespace net_utils m_current_speed_up(0) {} + connection_context_base(const connection_context_base& a): connection_context_base() + { + set_details(a.m_connection_id, a.m_remote_address, a.m_is_income); + } + connection_context_base& operator=(const connection_context_base& a) { set_details(a.m_connection_id, a.m_remote_address, a.m_is_income); diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp index 4d4658c4b8..a872e2f425 100644 --- a/src/device/device_ledger.cpp +++ b/src/device/device_ledger.cpp @@ -94,6 +94,18 @@ namespace hw { AKout = keys.AKout; } + ABPkeys &ABPkeys::operator=(const ABPkeys& keys) { + if (&keys == this) + return *this; + Aout = keys.Aout; + Bout = keys.Bout; + is_subaddress = keys.is_subaddress; + index = keys.index; + Pout = keys.Pout; + AKout = keys.AKout; + return *this; + } + bool Keymap::find(const rct::key& P, ABPkeys& keys) const { size_t sz = ABP.size(); for (size_t i=0; i Date: Sat, 8 Jun 2019 18:33:04 +0000 Subject: [PATCH 2/3] cmake: do not use -mmitigate-rop on GCC >= 9.1 /monero#5613 It was removed, but it still accepted by the compiler, which warns for every file --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19119395b1..fe5331fd31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -650,8 +650,11 @@ else() add_cxx_flag_if_supported(-fstack-clash-protection CXX_SECURITY_FLAGS) endif() - add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-mmitigate-rop CXX_SECURITY_FLAGS) + # Removed in GCC 9.1 (or before ?), but still accepted, so spams the output + if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1)) + add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS) + add_cxx_flag_if_supported(-mmitigate-rop CXX_SECURITY_FLAGS) + endif() # linker if (NOT WIN32) From 6e8eb4e1bc2540a763b5b47535fbb597848c9cb6 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 28 Aug 2019 15:13:50 +0000 Subject: [PATCH 3/3] simplewallet: fix warnings about useless std::move /monero#5865 --- src/simplewallet/simplewallet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 99d602dc4f..f13ee705ed 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -3694,7 +3694,7 @@ boost::optional simple_wallet::new_wallet(const boost::pr } success_msg_writer() << "**********************************************************************"; - return std::move(password); + return password; } //---------------------------------------------------------------------------------------------------- boost::optional simple_wallet::new_wallet(const boost::program_options::variables_map& vm, @@ -3741,7 +3741,7 @@ boost::optional simple_wallet::new_wallet(const boost::pr } - return std::move(password); + return password; } //---------------------------------------------------------------------------------------------------- @@ -3778,7 +3778,7 @@ boost::optional simple_wallet::new_wallet(const boost::pr return {}; } - return std::move(password); + return password; } //---------------------------------------------------------------------------------------------------- boost::optional simple_wallet::new_wallet(const boost::program_options::variables_map& vm, @@ -3831,7 +3831,7 @@ boost::optional simple_wallet::new_wallet(const boost::pr return {}; } - return std::move(password); + return password; } //---------------------------------------------------------------------------------------------------- bool simple_wallet::open_wallet(const boost::program_options::variables_map& vm)