ruby-changes:47335
From: nobu <ko1@a...>
Date: Sun, 30 Jul 2017 23:59:46 +0900 (JST)
Subject: [ruby-changes:47335] nobu:r59451 (trunk): UNALIGNED_MEMBER_ACCESS only for clang
nobu 2017-07-30 23:59:40 +0900 (Sun, 30 Jul 2017) New Revision: 59451 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59451 Log: 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. Modified files: trunk/eval_intern.h Index: eval_intern.h =================================================================== --- eval_intern.h (revision 59450) +++ eval_intern.h (revision 59451) @@ -157,7 +157,8 @@ LONG WINAPI rb_w32_stack_overflow_handle https://github.com/ruby/ruby/blob/trunk/eval_intern.h#L157 # 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\""); \ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/