From bcb9ca41053aa3db8d4d04d9d11dcd176b1a23e9 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 23 Mar 2021 18:16:20 +1100 Subject: MEM_CHECK_DEFINED: replace HAVE_valgrind HAVE_valgrind_or_MSAN to HAVE_valgrind was incorrect in af784385b4a2b286000fa2c658e34283fe7bba60. In my_valgrind.h when clang exists (hence no __has_feature(memory_sanitizer), and -DWITH_VALGRIND=1, but without memcheck.h, we end up with a MEM_CHECK_DEFINED being empty. If we are also doing a CMAKE_BUILD_TYPE=Debug this results a number of [-Werror,-Wunused-variable] errors because MEM_CHECK_DEFINED is empty. With MEM_CHECK_DEFINED empty, there becomes no uses of this of the fixed field and innodb variables in this patch. So we stop using HAVE_valgrind as catchall and use the name HAVE_CHECK_MEM to indicate that a CHECK_MEM_DEFINED function exists. Reviewer: Monty Corrects: af784385b4a2b286000fa2c658e34283fe7bba60 --- include/my_valgrind.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/my_valgrind.h b/include/my_valgrind.h index daea5266a28..260521d4d4b 100644 --- a/include/my_valgrind.h +++ b/include/my_valgrind.h @@ -27,6 +27,7 @@ #if __has_feature(memory_sanitizer) # include # define HAVE_valgrind +# define HAVE_MEM_CHECK # define MEM_UNDEFINED(a,len) __msan_allocated_memory(a,len) # define MEM_MAKE_ADDRESSABLE(a,len) MEM_UNDEFINED(a,len) # define MEM_MAKE_DEFINED(a,len) __msan_unpoison(a,len) @@ -38,6 +39,7 @@ # define REDZONE_SIZE 8 #elif defined(HAVE_VALGRIND_MEMCHECK_H) && defined(HAVE_valgrind) # include +# define HAVE_MEM_CHECK # define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len) # define MEM_MAKE_ADDRESSABLE(a,len) MEM_UNDEFINED(a,len) # define MEM_MAKE_DEFINED(a,len) VALGRIND_MAKE_MEM_DEFINED(a,len) -- cgit v1.2.1