fix warnings
authorMichael Wallner <mike@php.net>
Fri, 16 Oct 2020 12:00:58 +0000 (14:00 +0200)
committerMichael Wallner <mike@php.net>
Fri, 16 Oct 2020 12:01:01 +0000 (14:01 +0200)
CMakeConfig.txt
src/bin/memcapable.cc
src/libmemcached/CMakeLists.txt
src/libmemcached/byteorder.cc
test/lib/ReturnMatcher.hpp

index baced8881fe6d27588587c1be03b89025f0f7a1a..3f12665e87e4b2b2f6a2da5f389af94b8cc312ce 100644 (file)
@@ -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
index 33d9348518490ec44300435038bafa505cfc4b51..e9508c499915220e3650c00f8beb4ce0a9f4ab6f 100644 (file)
@@ -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;
index 819a98f7c225de3ad5d56cb973aec622329b4c4b..ff940faeb99bab19a711bd129e8e18c3d1a66718 100644 (file)
@@ -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)
index a32232a94cc104a36ed6d58ce38c0456e4e225f5..c3867a5afe01cc83bae5674ccb76b7201dff7498 100644 (file)
@@ -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
index 81c2d4813a8146b8c123aa300dfe957ac8503189..48c9ca28b532c2f1b8fdfb7ed9cb91fd90a53507 100644 (file)
@@ -10,7 +10,6 @@ public:
   {}
 
   ReturnMatcher(const ReturnMatcher &) = default;
-  ReturnMatcher &operator = (const ReturnMatcher &) = default;
 
   ReturnMatcher(ReturnMatcher &&rm);
   ReturnMatcher &operator = (ReturnMatcher &&rm);