[前][次][番号順一覧][スレッド一覧]

ruby-changes:51905

From: shyouhei <ko1@a...>
Date: Mon, 30 Jul 2018 16:53:34 +0900 (JST)
Subject: [ruby-changes:51905] shyouhei:r64119 (trunk): move #pragma out of functions

shyouhei	2018-07-30 16:53:24 +0900 (Mon, 30 Jul 2018)

  New Revision: 64119

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64119

  Log:
    move #pragma out of functions
    
    gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) reportedly fails to compile
    cf: https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos6/ruby-trunk/log/20180726T093003Z.fail.html.gz

  Modified files:
    trunk/mjit.c
    trunk/process.c
Index: mjit.c
===================================================================
--- mjit.c	(revision 64118)
+++ mjit.c	(revision 64119)
@@ -352,6 +352,10 @@ form_args(int num, ...) https://github.com/ruby/ruby/blob/trunk/mjit.c#L352
     return res;
 }
 
+COMPILER_WARNING_PUSH
+#ifdef __GNUC__
+COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
+#endif
 /* Start an OS process of executable PATH with arguments ARGV.  Return
    PID of the process.
    TODO: Use the same function in process.c */
@@ -387,13 +391,7 @@ start_process(const char *path, char *co https://github.com/ruby/ruby/blob/trunk/mjit.c#L391
         }
         dev_null = rb_cloexec_open(ruby_null_device, O_WRONLY, 0);
 
-        COMPILER_WARNING_PUSH;
-#ifdef __GNUC__
-        COMPILER_WARNING_IGNORED(-Wdeprecated-declarations);
-#endif
         if ((pid = vfork()) == 0) {
-        COMPILER_WARNING_POP;
-
             umask(0077);
             if (mjit_opts.verbose == 0) {
                 /* CC can be started in a thread using a file which has been
@@ -415,6 +413,7 @@ start_process(const char *path, char *co https://github.com/ruby/ruby/blob/trunk/mjit.c#L413
 #endif
     return pid;
 }
+COMPILER_WARNING_POP
 
 /* Execute an OS process of executable PATH with arguments ARGV.
    Return -1 or -2 if failed to execute, otherwise exit code of the process.
Index: process.c
===================================================================
--- process.c	(revision 64118)
+++ process.c	(revision 64119)
@@ -3959,6 +3959,10 @@ disable_child_handler_fork_child(struct https://github.com/ruby/ruby/blob/trunk/process.c#L3959
     return 0;
 }
 
+COMPILER_WARNING_PUSH
+#ifdef __GNUC__
+COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
+#endif
 static rb_pid_t
 retry_fork_async_signal_safe(int *status, int *ep,
         int (*chfunc)(void*, char *, size_t), void *charg,
@@ -3972,10 +3976,6 @@ retry_fork_async_signal_safe(int *status https://github.com/ruby/ruby/blob/trunk/process.c#L3976
     while (1) {
         prefork();
         disable_child_handler_before_fork(&old);
-        COMPILER_WARNING_PUSH;
-#ifdef __GNUC__
-        COMPILER_WARNING_IGNORED(-Wdeprecated-declarations);
-#endif
 #ifdef HAVE_WORKING_VFORK
         if (!has_privilege())
             pid = vfork();
@@ -3984,7 +3984,6 @@ retry_fork_async_signal_safe(int *status https://github.com/ruby/ruby/blob/trunk/process.c#L3984
 #else
         pid = fork();
 #endif
-        COMPILER_WARNING_POP;
         if (pid == 0) {/* fork succeed, child process */
             int ret;
             close(ep[0]);
@@ -4009,6 +4008,7 @@ retry_fork_async_signal_safe(int *status https://github.com/ruby/ruby/blob/trunk/process.c#L4008
             return -1;
     }
 }
+COMPILER_WARNING_POP
 
 rb_pid_t
 rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds,
@@ -4040,6 +4040,10 @@ rb_fork_async_signal_safe(int *status, i https://github.com/ruby/ruby/blob/trunk/process.c#L4040
     return pid;
 }
 
+COMPILER_WARNING_PUSH
+#ifdef __GNUC__
+COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
+#endif
 rb_pid_t
 rb_fork_ruby(int *status)
 {
@@ -4053,14 +4057,7 @@ rb_fork_ruby(int *status) https://github.com/ruby/ruby/blob/trunk/process.c#L4057
 	prefork();
 	disable_child_handler_before_fork(&old);
 	before_fork_ruby();
-        COMPILER_WARNING_PUSH;
-#ifdef __GNUC__
-        COMPILER_WARNING_IGNORED(-Wdeprecated-declarations);
-#endif
 	pid = fork();
-#ifdef __GNUC__
-        COMPILER_WARNING_POP;
-#endif
 	err = errno;
 	after_fork_ruby();
 	disable_child_handler_fork_parent(&old); /* yes, bad name */
@@ -4071,6 +4068,7 @@ rb_fork_ruby(int *status) https://github.com/ruby/ruby/blob/trunk/process.c#L4068
 	    return -1;
     }
 }
+COMPILER_WARNING_POP
 
 #endif
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]