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
This commit is contained in:
shyouhei 2018-07-30 07:07:48 +00:00
parent 7018acc946
commit d83536c980
7 changed files with 61 additions and 38 deletions

8
cont.c
View file

@ -628,9 +628,9 @@ show_vm_pcs(const rb_control_frame_t *cfp,
}
}
#endif
COMPILER_WARNING_PUSH
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wduplicate-decl-specifier"
COMPILER_WARNING_IGNORED(-Wduplicate-decl-specifier)
#endif
static VALUE
cont_capture(volatile int *volatile stat)
@ -694,9 +694,7 @@ cont_capture(volatile int *volatile stat)
return contval;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
COMPILER_WARNING_POP
static inline void
fiber_restore_thread(rb_thread_t *th, rb_fiber_t *fib)