From 882a4e3e223bb8d54cf2a2d67ffbe54b134fd639 Mon Sep 17 00:00:00 2001 From: anatol Date: Sat, 30 Dec 2023 12:39:47 +0200 Subject: [PATCH] c++23 build with stacktrace --- CMakeLists.txt | 4 ++-- bvm/ManagerStd.cpp | 3 --- mnemonic/mnemonic.cpp | 6 +++--- wallet/core/contracts/shaders_manager.cpp | 3 +++ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2389b893b..036ebaf2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,7 +109,7 @@ target_include_directories(beam INTERFACE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/3rdparty) -target_compile_features(beam INTERFACE cxx_std_17) +target_compile_features(beam INTERFACE cxx_std_23) file(WRITE ${PROJECT_SOURCE_DIR}/beam_version.gen "${PROJECT_VERSION}") @@ -121,7 +121,7 @@ endif() include(AddTest) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(BEAM_USE_AVX FALSE) diff --git a/bvm/ManagerStd.cpp b/bvm/ManagerStd.cpp index c32b6b79a..e48b318fc 100644 --- a/bvm/ManagerStd.cpp +++ b/bvm/ManagerStd.cpp @@ -586,12 +586,9 @@ namespace bvm2 { { while (!IsDone()) { - LOG_INFO() << __FUNCTION__ << "[" << __LINE__ << "]"; if (IsSuspended()) return; - LOG_INFO() << __FUNCTION__ << "[" << __LINE__ << "]"; RunOnce(); - LOG_INFO() << __FUNCTION__ << "[" << __LINE__ << "]"; } LOG_INFO() << __FUNCTION__ << "[" << __LINE__ << "]"; OnDone(nullptr); diff --git a/mnemonic/mnemonic.cpp b/mnemonic/mnemonic.cpp index e2783cef6..152d3f65e 100644 --- a/mnemonic/mnemonic.cpp +++ b/mnemonic/mnemonic.cpp @@ -105,11 +105,11 @@ namespace beam bool isAllowedWord(const string& word, const Dictionary& dict) { - auto predicate = [] (const char* left, const char* right) { + auto sortPredicate = [] (const char* left, const char* right) { return strcmp(left, right) < 0; }; - assert(is_sorted(dict.begin(), dict.end(), predicate)); - return binary_search(dict.begin(), dict.end(), word.c_str(), predicate); + assert(is_sorted(dict.begin(), dict.end(), sortPredicate)); + return binary_search(dict.begin(), dict.end(), word.c_str(), sortPredicate); } bool isValidMnemonic(const WordList& words, const Dictionary& dict) diff --git a/wallet/core/contracts/shaders_manager.cpp b/wallet/core/contracts/shaders_manager.cpp index 91ded11f7..5e1a04cab 100644 --- a/wallet/core/contracts/shaders_manager.cpp +++ b/wallet/core/contracts/shaders_manager.cpp @@ -14,6 +14,7 @@ #include #include "shaders_manager.h" #include "utility/logger.h" +#include namespace beam::wallet { @@ -263,6 +264,7 @@ namespace beam::wallet { LOG_INFO() << __FUNCTION__ << "[" << __LINE__ << "]"; if (_queue.empty()) { + LOG_INFO() << __FUNCTION__ << "[" << __LINE__ << "] no requests"; return; } LOG_INFO() << __FUNCTION__ << "[" << __LINE__ << "]"; @@ -370,6 +372,7 @@ namespace beam::wallet { void ShadersManager::OnDone(const std::exception *pExc) { + LOG_INFO() << "Stacktrace: " << std::to_string(std::stacktrace::current()); LOG_INFO() << __FUNCTION__ << "[" << __LINE__ << "]"; if (pExc && pExc->what() && pExc->what()[0] != 0) {