From 24e6e50be3f7f402c59c7bab5d02657a29e752cb Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 16 Oct 2020 14:00:58 +0200 Subject: [PATCH] fix warnings --- CMakeConfig.txt | 3 +-- src/bin/memcapable.cc | 3 --- src/libmemcached/CMakeLists.txt | 10 ++++++++++ src/libmemcached/byteorder.cc | 2 ++ test/lib/ReturnMatcher.hpp | 1 - 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CMakeConfig.txt b/CMakeConfig.txt index baced888..3f12665e 100644 --- a/CMakeConfig.txt +++ b/CMakeConfig.txt @@ -48,8 +48,7 @@ set(ENABLE_SANITIZERS $ENV{ENABLE_SANITIZERS} CACHE STRING "sanitizers to enable (e.g. address undefined ...)") if(BUILD_TESTING) - set(MEMCACHED_BINARY "/usr/bin/memcached" - CACHE FILEPATH "memcached binary") + find_program(MEMCACHED_BINARY memcached DOC "memcached binary") set(CMAKE_CTEST_ARGUMENTS "--output-on-failure") if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17) # available since CMake 3.17 diff --git a/src/bin/memcapable.cc b/src/bin/memcapable.cc index 33d93485..e9508c49 100644 --- a/src/bin/memcapable.cc +++ b/src/bin/memcapable.cc @@ -2083,9 +2083,6 @@ struct testcase testcases[]= { { NULL, NULL} }; -const int ascii_tests = 1; -const int binary_tests = 2; - struct test_type_st { bool ascii; diff --git a/src/libmemcached/CMakeLists.txt b/src/libmemcached/CMakeLists.txt index 819a98f7..ff940fae 100644 --- a/src/libmemcached/CMakeLists.txt +++ b/src/libmemcached/CMakeLists.txt @@ -71,6 +71,16 @@ set(LIBMEMCACHED_SOURCES version.cc virtual_bucket.c) +check_cxx_compiler_flag(-Wno-deprecated-register W_NO_DEPRECATED_REGISTER) + +if(W_NO_DEPRECATED_REGISTER) + set_source_files_properties( + ${FLEX_CSL_SCANNER_OUTPUTS} + ${BISON_CSL_PARSER_OUTPUTS} + PROPERTIES COMPILE_OPTIONS -Wno-deprecated-register + ) +endif() + add_library(libmemcached SHARED ${LIBMEMCACHED_SOURCES}) add_library(memcached ALIAS libmemcached) diff --git a/src/libmemcached/byteorder.cc b/src/libmemcached/byteorder.cc index a32232a9..c3867a5a 100644 --- a/src/libmemcached/byteorder.cc +++ b/src/libmemcached/byteorder.cc @@ -40,6 +40,7 @@ /* Byte swap a 64-bit number. */ #ifndef swap64 +# ifndef HAVE_HTONLL static inline uint64_t swap64(uint64_t in) { #if !WORDS_BIGENDIAN @@ -57,6 +58,7 @@ static inline uint64_t swap64(uint64_t in) return in; #endif // WORDS_BIGENDIAN } +# endif #endif #ifdef HAVE_SYS_TYPES_H diff --git a/test/lib/ReturnMatcher.hpp b/test/lib/ReturnMatcher.hpp index 81c2d481..48c9ca28 100644 --- a/test/lib/ReturnMatcher.hpp +++ b/test/lib/ReturnMatcher.hpp @@ -10,7 +10,6 @@ public: {} ReturnMatcher(const ReturnMatcher &) = default; - ReturnMatcher &operator = (const ReturnMatcher &) = default; ReturnMatcher(ReturnMatcher &&rm); ReturnMatcher &operator = (ReturnMatcher &&rm); -- 2.30.2