From 93780c25f71bd3f3233d03db45d4ee5cea844f7d Mon Sep 17 00:00:00 2001 From: seelabs Date: Wed, 2 May 2018 10:46:17 -0400 Subject: [PATCH] Resolve gcc8 warnings --- CMakeLists.txt | 6 +++--- src/ripple/json/impl/json_value.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eea6d53bc..e03513a63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -420,9 +420,9 @@ add_with_props(rippled_src_all src/ripple/unity/ed25519_donna.c -I"${CMAKE_SOURCE_DIR}/"src/ed25519-donna) if (is_gcc) - set(no_init_w -Wno-maybe-uninitialized) + set(no_gcc_warnings -w) else() - unset(no_init_w) + unset(no_gcc_warnings) endif() add_with_props(rippled_src_all src/ripple/unity/rocksdb.cpp @@ -430,7 +430,7 @@ add_with_props(rippled_src_all src/ripple/unity/rocksdb.cpp -I"${CMAKE_SOURCE_DIR}/"src/rocksdb2/include -I"${CMAKE_SOURCE_DIR}/"src/snappy/snappy -I"${CMAKE_SOURCE_DIR}/"src/snappy/config - ${no_init_w} ${rocks_db_system_header}) + ${no_gcc_warnings} ${rocks_db_system_header}) if (NOT is_msvc) set(no_unused_w -Wno-unused-function) diff --git a/src/ripple/json/impl/json_value.cpp b/src/ripple/json/impl/json_value.cpp index c3a4a865c..7c44e0b93 100644 --- a/src/ripple/json/impl/json_value.cpp +++ b/src/ripple/json/impl/json_value.cpp @@ -365,7 +365,8 @@ Value::Value ( Value&& other ) noexcept , type_ ( other.type_ ) , allocated_ ( other.allocated_ ) { - std::memset( &other, 0, sizeof(Value) ); + other.type_ = nullValue; + other.allocated_ = 0; } Value&