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

ruby-changes:51152

From: nobu <ko1@a...>
Date: Tue, 8 May 2018 19:59:01 +0900 (JST)
Subject: [ruby-changes:51152] nobu:r63359 (trunk): vm_eval.c: eval_string_protect wrapper

nobu	2018-05-08 19:58:56 +0900 (Tue, 08 May 2018)

  New Revision: 63359

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

  Log:
    vm_eval.c: eval_string_protect wrapper
    
    * vm_eval.c (eval_string_protect): cast data instead of the
      function pointer, to suppress "cast between incompatible
      function types" warning by gcc 8.1.

  Modified files:
    trunk/vm_eval.c
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 63358)
+++ vm_eval.c	(revision 63359)
@@ -1433,6 +1433,12 @@ rb_eval_string(const char *str) https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1433
     return ruby_eval_string_from_file(str, "eval");
 }
 
+static VALUE
+eval_string_protect(VALUE str)
+{
+    return rb_eval_string((char *)str);
+}
+
 /**
  * Evaluates the given string in an isolated binding.
  *
@@ -1446,7 +1452,7 @@ rb_eval_string(const char *str) https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1452
 VALUE
 rb_eval_string_protect(const char *str, int *pstate)
 {
-    return rb_protect((VALUE (*)(VALUE))rb_eval_string, (VALUE)str, pstate);
+    return rb_protect(eval_string_protect, (VALUE)str, pstate);
 }
 
 /**

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

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