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

ruby-changes:28707

From: nobu <ko1@a...>
Date: Wed, 15 May 2013 17:06:22 +0900 (JST)
Subject: [ruby-changes:28707] nobu:r40760 (trunk): vm.c: suppress warnings

nobu	2013-05-15 17:06:10 +0900 (Wed, 15 May 2013)

  New Revision: 40760

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40760

  Log:
    vm.c: suppress warnings
    
    * vm.c (vm_invoke_proc, vm_exec), vm_eval.c (rb_eval_cmd): add
      volatile to suppress -Wclobbered warnings by gcc 4.9.0.

  Modified files:
    trunk/vm.c
    trunk/vm_eval.c

Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 40759)
+++ vm_eval.c	(revision 40760)
@@ -1432,7 +1432,7 @@ VALUE https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1432
 rb_eval_cmd(VALUE cmd, VALUE arg, int level)
 {
     int state;
-    VALUE val = Qnil;		/* OK */
+    volatile VALUE val = Qnil;		/* OK */
     volatile int safe = rb_safe_level();
 
     if (OBJ_TAINTED(cmd)) {
Index: vm.c
===================================================================
--- vm.c	(revision 40759)
+++ vm.c	(revision 40760)
@@ -682,7 +682,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/vm.c#L682
 vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self, VALUE defined_class,
 	       int argc, const VALUE *argv, const rb_block_t *blockptr)
 {
-    VALUE val = Qundef;
+    volatile VALUE val = Qundef;
     int state;
     volatile int stored_safe = th->safe_level;
 
@@ -1190,7 +1190,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1190
     int state;
     VALUE result, err;
     VALUE initial = 0;
-    VALUE *escape_ep = NULL;
+    VALUE *volatile escape_ep = NULL;
 
     TH_PUSH_TAG(th);
     _tag.retval = Qnil;

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

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