summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-06 02:57:28 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-06 02:57:28 +0000
commit16f5b18b7aa505765a5361a7d828e33963ea61bc (patch)
tree30351cff4f9c26f83dc9d01caa83af29ca5cedd3 /internal.h
parentee7af44257726eb141de76eace950d47c9785f2f (diff)
gc.c: move ASAN check to configure
Availability of attributes are checked in configure these days, rather than compiler macros. Also __attribute__((no_address_safety_analysis)) is considered deprecated in both GCC and Clang. Use the current best practice if available. See also: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html https://clang.llvm.org/docs/AddressSanitizer.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 07d5dee5ac..d5e34c1767 100644
--- a/internal.h
+++ b/internal.h
@@ -54,6 +54,20 @@ extern "C" {
# define WARN_UNUSED_RESULT(x) x
#endif
+#if 0
+#elif defined(NO_SANITIZE)
+# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
+ NO_SANITIZE("address", NOINLINE(x))
+#elif defined(NO_SANITIZE_ADDRESS)
+# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
+ NO_SANITIZE_ADDRESS(NOINLINE(x))
+#elif defined(NO_ADDRESS_SAFETY_ANALYSIS)
+# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
+ NO_ADDRESS_SAFETY_ANALYSIS(NOINLINE(x))
+#else
+# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
+#endif
+
#ifdef HAVE_VALGRIND_MEMCHECK_H
# include <valgrind/memcheck.h>
# ifndef VALGRIND_MAKE_MEM_DEFINED