From 8e812504b4c5408280fc3699d821448f65f17d05 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 25 May 2019 11:24:13 +1000 Subject: Cleanup: warnings building without ASAN --- source/blender/blenlib/intern/BLI_memarena.c | 5 +++-- source/blender/blenlib/intern/BLI_memiter.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c index 0f7ac92a348..b20a0eafd74 100644 --- a/source/blender/blenlib/intern/BLI_memarena.c +++ b/source/blender/blenlib/intern/BLI_memarena.c @@ -53,8 +53,9 @@ #if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer) # include "sanitizer/asan_interface.h" #else -# define ASAN_POISON_MEMORY_REGION(addr, size) UNUSED_VARS(addr, size) -# define ASAN_UNPOISON_MEMORY_REGION(addr, size) UNUSED_VARS(addr, size) +/* Ensure return value is used. */ +# define ASAN_POISON_MEMORY_REGION(addr, size) (void)(0 && ((size) != 0 && (addr) != NULL)) +# define ASAN_UNPOISON_MEMORY_REGION(addr, size) (void)(0 && ((size) != 0 && (addr) != NULL)) #endif struct MemBuf { diff --git a/source/blender/blenlib/intern/BLI_memiter.c b/source/blender/blenlib/intern/BLI_memiter.c index 2d3ba56d08e..4027a62bbcc 100644 --- a/source/blender/blenlib/intern/BLI_memiter.c +++ b/source/blender/blenlib/intern/BLI_memiter.c @@ -57,8 +57,9 @@ #if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer) # include "sanitizer/asan_interface.h" #else -# define ASAN_POISON_MEMORY_REGION(addr, size) UNUSED_VARS(addr, size) -# define ASAN_UNPOISON_MEMORY_REGION(addr, size) UNUSED_VARS(addr, size) +/* Ensure return value is used. */ +# define ASAN_POISON_MEMORY_REGION(addr, size) (void)(0 && ((size) != 0 && (addr) != NULL)) +# define ASAN_UNPOISON_MEMORY_REGION(addr, size) (void)(0 && ((size) != 0 && (addr) != NULL)) #endif typedef uintptr_t data_t; -- cgit v1.2.3