diff options
author | Daniel Black <daniel@mariadb.org> | 2021-03-23 18:16:20 +1100 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2021-03-26 07:58:49 +1100 |
commit | bcb9ca41053aa3db8d4d04d9d11dcd176b1a23e9 (patch) | |
tree | f99837b5dfaf1dd0b40ebda05739ba73e4381bfc /include | |
parent | e731a283942c3ec2386d79b639317131645caa1e (diff) | |
download | mariadb-git-bcb9ca41053aa3db8d4d04d9d11dcd176b1a23e9.tar.gz |
MEM_CHECK_DEFINED: replace HAVE_valgrindbb-10.5-danielblack-clang-valgrind-without-memcheck_h
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
Diffstat (limited to 'include')
-rw-r--r-- | include/my_valgrind.h | 2 |
1 files changed, 2 insertions, 0 deletions
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 <sanitizer/msan_interface.h> # 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 <valgrind/memcheck.h> +# 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) |