From 84d83482c8ba1b8e7002ed8ff4c6a2c00fa4ce62 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 30 Jul 2017 14:59:40 +0000 Subject: [PATCH] UNALIGNED_MEMBER_ACCESS only for clang * eval_intern.h (UNALIGNED_MEMBER_ACCESS): enable only on clang. gcc does not complain about pointers to member of unaligned struct. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval_intern.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eval_intern.h b/eval_intern.h index 610546153f..2209504aa7 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -157,7 +157,8 @@ LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *); # define VAR_NOCLOBBERED(var) var #endif -#if defined(USE_UNALIGNED_MEMBER_ACCESS) && USE_UNALIGNED_MEMBER_ACCESS +#if defined(USE_UNALIGNED_MEMBER_ACCESS) && USE_UNALIGNED_MEMBER_ACCESS && \ + defined(__clang__) # define UNALIGNED_MEMBER_ACCESS(expr) __extension__({ \ _Pragma("GCC diagnostic push"); \ _Pragma("GCC diagnostic ignored \"-Waddress-of-packed-member\""); \