MEM_CHECK_DEFINED: replace HAVE_valgrind

HAVE_valgrind_or_MSAN to HAVE_valgrind was incorrect in
af784385b4.

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: af784385b4
This commit is contained in:
Daniel Black 2021-03-23 18:16:20 +11:00
commit bcb9ca4105
5 changed files with 12 additions and 10 deletions

View file

@ -637,14 +637,14 @@ Use MONITOR_DEC if appropriate mutex protection exists.
} \
}
#ifdef HAVE_valgrind
#ifdef HAVE_MEM_CHECK
# define MONITOR_CHECK_DEFINED(value) do { \
mon_type_t m = value; \
MEM_CHECK_DEFINED(&m, sizeof m); \
} while (0)
#else /* HAVE_valgrind */
#else /* HAVE_MEM_CHECK */
# define MONITOR_CHECK_DEFINED(value) (void) 0
#endif /* HAVE_valgrind */
#endif /* HAVE_MEM_CHECK */
#define MONITOR_INC_VALUE(monitor, value) \
MONITOR_CHECK_DEFINED(value); \