Use "$!" specifier of `mrb_get_args`.
MODIFY
mrbgems/mruby-eval/src/eval.c
mrbgems/mruby-eval/src/eval.c
@@ -255,7 +255,7 @@ f_instance_eval(mrb_state *mrb, mrb_value self)
mrb_value b;
mrb_int argc; mrb_value *argv;
- mrb_get_args(mrb, "*&", &argv, &argc, &b);
+ mrb_get_args(mrb, "*!&", &argv, &argc, &b);
if (mrb_nil_p(b)) {
char *s;

MODIFY
mrbgems/mruby-fiber/src/fiber.c
mrbgems/mruby-fiber/src/fiber.c
@@ -253,7 +253,7 @@ fiber_resume(mrb_state *mrb, mrb_value self)
mrb_int len;
mrb_bool vmexec = FALSE;
- mrb_get_args(mrb, "*", &a, &len);
+ mrb_get_args(mrb, "*!", &a, &len);
if (mrb->c->ci->acc < 0) {
vmexec = TRUE;
}
@@ -313,7 +313,7 @@ fiber_transfer(mrb_state *mrb, mrb_value self)
mrb_int len;
fiber_check_cfunc(mrb, mrb->c);
- mrb_get_args(mrb, "*", &a, &len);
+ mrb_get_args(mrb, "*!", &a, &len);
if (c == mrb->root_c) {
mrb->c->status = MRB_FIBER_TRANSFERRED;
@@ -371,7 +371,7 @@ fiber_yield(mrb_state *mrb, mrb_value self)
mrb_value *a;
mrb_int len;
- mrb_get_args(mrb, "*", &a, &len);
+ mrb_get_args(mrb, "*!", &a, &len);
return mrb_fiber_yield(mrb, len, a);
}

MODIFY
mrbgems/mruby-hash-ext/src/hash-ext.c
mrbgems/mruby-hash-ext/src/hash-ext.c
@@ -26,7 +26,7 @@ hash_values_at(mrb_state *mrb, mrb_value hash)
mrb_int argc, i;
int ai;
- mrb_get_args(mrb, "*", &argv, &argc);
+ mrb_get_args(mrb, "*!", &argv, &argc);
result = mrb_ary_new_capa(mrb, argc);
ai = mrb_gc_arena_save(mrb);
for (i = 0; i < argc; i++) {

MODIFY
mrbgems/mruby-struct/src/struct.c
mrbgems/mruby-struct/src/struct.c
@@ -345,7 +345,7 @@ mrb_struct_initialize(mrb_state *mrb, mrb_value self)
mrb_value *argv;
mrb_int argc;
- mrb_get_args(mrb, "*", &argv, &argc);
+ mrb_get_args(mrb, "*!", &argv, &argc);
return mrb_struct_initialize_withArg(mrb, argc, argv, self);
}

MODIFY
src/array.c
src/array.c
@@ -255,7 +255,7 @@ mrb_ary_s_create(mrb_state *mrb, mrb_value klass)
mrb_int len;
struct RArray *a;
- mrb_get_args(mrb, "*", &vals, &len);
+ mrb_get_args(mrb, "*!", &vals, &len);
ary = mrb_ary_new_from_values(mrb, len, vals);
a = mrb_ary_ptr(ary);
a->c = mrb_class_ptr(klass);
@@ -438,7 +438,7 @@ mrb_ary_push_m(mrb_state *mrb, mrb_value self)
mrb_value *argv;
mrb_int len;
- mrb_get_args(mrb, "*", &argv, &len);
+ mrb_get_args(mrb, "*!", &argv, &len);
while (len--) {
mrb_ary_push(mrb, self, *argv++);
}
@@ -526,7 +526,7 @@ mrb_ary_unshift_m(mrb_state *mrb, mrb_value self)
mrb_value *vals;
mrb_int len;
- mrb_get_args(mrb, "*", &vals, &len);
+ mrb_get_args(mrb, "*!", &vals, &len);
if (len > ARY_MAX_SIZE - a->len) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "array size too big");
}
@@ -717,7 +717,7 @@ aget_index(mrb_state *mrb, mrb_value index)
mrb_int i, argc;
mrb_value *argv;
- mrb_get_args(mrb, "i*", &i, &argv, &argc);
+ mrb_get_args(mrb, "i*!", &i, &argv, &argc);
return i;
}
}

MODIFY
src/error.c
src/error.c
@@ -47,7 +47,7 @@ exc_initialize(mrb_state *mrb, mrb_value exc)
mrb_int argc;
mrb_value *argv;
- if (mrb_get_args(mrb, "|o*", &mesg, &argv, &argc) >= 1) {
+ if (mrb_get_args(mrb, "|o*!", &mesg, &argv, &argc) >= 1) {
mrb_iv_set(mrb, exc, mrb_intern_lit(mrb, "mesg"), mesg);
}
return exc;

MODIFY
src/kernel.c
src/kernel.c
@@ -981,7 +981,7 @@ mrb_obj_missing(mrb_state *mrb, mrb_value mod)
mrb_value *a;
mrb_int alen;
- mrb_get_args(mrb, "n*", &name, &a, &alen);
+ mrb_get_args(mrb, "n*!", &name, &a, &alen);
mrb_method_missing(mrb, name, mod, mrb_ary_new_from_values(mrb, alen, a));
/* not reached */
return mrb_nil_value();

MODIFY
src/string.c
src/string.c
@@ -1597,7 +1597,7 @@ mrb_str_index(mrb_state *mrb, mrb_value str)
mrb_value sub;
mrb_int pos, clen;
- mrb_get_args(mrb, "*", &argv, &argc);
+ mrb_get_args(mrb, "*!", &argv, &argc);
if (argc == 2) {
mrb_get_args(mrb, "oi", &sub, &pos);
}
@@ -1868,7 +1868,7 @@ mrb_str_rindex(mrb_state *mrb, mrb_value str)
mrb_value sub;
mrb_int pos, len = RSTRING_CHAR_LEN(str);
- mrb_get_args(mrb, "*", &argv, &argc);
+ mrb_get_args(mrb, "*!", &argv, &argc);
if (argc == 2) {
mrb_get_args(mrb, "oi", &sub, &pos);
if (pos < 0) {

Use "$!" specifier of `mrb_get_args`.