1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2017-07-30 14:59:40 +00:00
parent 2b582b7ca6
commit 84d83482c8

View file

@ -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\""); \