summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-08 10:58:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-08 10:58:56 +0000
commitb755fe889a7f37bce869c719662747dc0891c46e (patch)
treecc6f2f058f8cf1202ee2ed5a3b45d3fe027dbfd1 /vm_eval.c
parent841d5ae80e7d77f18b42f06423589ef7aa0be3e7 (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/vm_eval.c b/vm_eval.c
index e87f9fdac0..df93d000dd 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1433,6 +1433,12 @@ rb_eval_string(const char *str)
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)
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);
}
/**