aboutsummaryrefslogtreecommitdiffstats
path: root/eval_intern.h
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-30 07:07:48 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-30 07:07:48 +0000
commit0d65bffffc36f4f1fe7cca927362757515ac9d2c (patch)
treeac970bbba01d5b04b4d0ab7c0175e996d7468875 /eval_intern.h
parent52ede226c9ab9ca75675d616eb70727ad62c52a5 (diff)
downloadruby-0d65bffffc36f4f1fe7cca927362757515ac9d2c.tar.gz
reduce copy & paste
We see several occurrence of "diagnostic push/pop" so why not make them macros. Tested on GCC8 / Clang 6. Note that ruby.h is intentionally left untouched because we don't want to introduce new public macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_intern.h')
-rw-r--r--eval_intern.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/eval_intern.h b/eval_intern.h
index 5352be44f6..f4a48d8171 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -160,10 +160,10 @@ LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *);
#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\""); \
+ COMPILER_WARNING_PUSH; \
+ COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \
typeof(expr) unaligned_member_access_result = (expr); \
- _Pragma("GCC diagnostic pop"); \
+ COMPILER_WARNING_POP; \
unaligned_member_access_result; \
})
#else