From d83536c980fb96a880def3e952eb4920815eeb51 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Mon, 30 Jul 2018 07:07:48 +0000 Subject: 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 --- eval_intern.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'eval_intern.h') 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 -- cgit v1.2.1