diff --git a/ChangeLog b/ChangeLog index dfaeaa3f13..585976b8f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Jul 1 20:55:07 2008 URABE Shyouhei + + * eval.c (rb_interrupt): trick to suppress GCC warning. + + * sprintf.c (rb_str_format): ditto. + Tue Jul 1 20:44:36 2008 Koichi Sasada * tool/instruction.rb: RubyVM is not module. diff --git a/eval.c b/eval.c index 3e9512e5f8..40eec61a88 100644 --- a/eval.c +++ b/eval.c @@ -435,8 +435,7 @@ rb_exc_fatal(VALUE mesg) void rb_interrupt(void) { - static const char fmt[1] = {'\0'}; - rb_raise(rb_eInterrupt, fmt); + rb_raise(rb_eInterrupt, "%s", ""); } static VALUE get_errinfo(void); diff --git a/sprintf.c b/sprintf.c index 57e1cbb681..e5ac2a4408 100644 --- a/sprintf.c +++ b/sprintf.c @@ -979,8 +979,8 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt) */ if (posarg >= 0 && nextarg < argc) { const char *mesg = "too many arguments for format string"; - if (RTEST(ruby_debug)) rb_raise(rb_eArgError, mesg); - if (RTEST(ruby_verbose)) rb_warn(mesg); + if (RTEST(ruby_debug)) rb_raise(rb_eArgError, "%s", mesg); + if (RTEST(ruby_verbose)) rb_warn("%s", mesg); } rb_str_resize(result, blen);