summaryrefslogtreecommitdiff
path: root/mjit.c
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
commitd83536c980fb96a880def3e952eb4920815eeb51 (patch)
treeac970bbba01d5b04b4d0ab7c0175e996d7468875 /mjit.c
parent7018acc946882f21d519af7c42ccf84b22a46b27 (diff)
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 'mjit.c')
-rw-r--r--mjit.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/mjit.c b/mjit.c
index 5668b1a6e9..3599aa6c9e 100644
--- a/mjit.c
+++ b/mjit.c
@@ -387,14 +387,13 @@ start_process(const char *path, char *const *argv)
}
dev_null = rb_cloexec_open(ruby_null_device, O_WRONLY, 0);
+ COMPILER_WARNING_PUSH;
#ifdef __GNUC__
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ COMPILER_WARNING_IGNORED(-Wdeprecated-declarations);
#endif
if ((pid = vfork()) == 0) {
-#ifdef __GNUC__
-# pragma GCC diagnostic pop
-#endif
+ COMPILER_WARNING_POP;
+
umask(0077);
if (mjit_opts.verbose == 0) {
/* CC can be started in a thread using a file which has been