From bba7234a531899e10eb4c0af2ef4195522c256f4 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 21 Nov 2017 00:17:51 +0300 Subject: [PATCH] Fix 'unknown attribute no_sanitize' compiler warnings for GCC (fix commits ce75cf1, b850e1c) * include/private/gc_priv.h [!GC_ATTR_NO_SANITIZE_ADDR && ADDRESS_SANITIZER && !AO_CLANG_PREREQ(3,8)] (GC_ATTR_NO_SANITIZE_ADDR): Define to __attribute__((no_sanitize_address)). * include/private/gc_priv.h [!GC_ATTR_NO_SANITIZE_MEMORY && MEMORY_SANITIZER && !AO_CLANG_PREREQ(3,8)] (GC_ATTR_NO_SANITIZE_MEMORY): Define to __attribute__((no_sanitize_memory)). * include/private/gc_priv.h [!GC_ATTR_NO_SANITIZE_THREAD && THREAD_SANITIZER && !AO_CLANG_PREREQ(3,8)] (GC_ATTR_NO_SANITIZE_THREAD): Define to __attribute__((no_sanitize_thread)). --- include/private/gc_priv.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 83298d67..5fe89f66 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -155,26 +155,32 @@ typedef char * ptr_t; /* A generic pointer to which we can add */ #endif #ifndef GC_ATTR_NO_SANITIZE_ADDR -# ifdef ADDRESS_SANITIZER +# ifndef ADDRESS_SANITIZER +# define GC_ATTR_NO_SANITIZE_ADDR /* empty */ +# elif GC_CLANG_PREREQ(3, 8) # define GC_ATTR_NO_SANITIZE_ADDR __attribute__((no_sanitize("address"))) # else -# define GC_ATTR_NO_SANITIZE_ADDR /* empty */ +# define GC_ATTR_NO_SANITIZE_ADDR __attribute__((no_sanitize_address)) # endif #endif /* !GC_ATTR_NO_SANITIZE_ADDR */ #ifndef GC_ATTR_NO_SANITIZE_MEMORY -# ifdef MEMORY_SANITIZER +# ifndef MEMORY_SANITIZER +# define GC_ATTR_NO_SANITIZE_MEMORY /* empty */ +# elif GC_CLANG_PREREQ(3, 8) # define GC_ATTR_NO_SANITIZE_MEMORY __attribute__((no_sanitize("memory"))) # else -# define GC_ATTR_NO_SANITIZE_MEMORY /* empty */ +# define GC_ATTR_NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory)) # endif #endif /* !GC_ATTR_NO_SANITIZE_MEMORY */ #ifndef GC_ATTR_NO_SANITIZE_THREAD -# ifdef THREAD_SANITIZER +# ifndef THREAD_SANITIZER +# define GC_ATTR_NO_SANITIZE_THREAD /* empty */ +# elif GC_CLANG_PREREQ(3, 8) # define GC_ATTR_NO_SANITIZE_THREAD __attribute__((no_sanitize("thread"))) # else -# define GC_ATTR_NO_SANITIZE_THREAD /* empty */ +# define GC_ATTR_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread)) # endif #endif /* !GC_ATTR_NO_SANITIZE_THREAD */ -- 2.40.0