diff --git a/ChangeLog b/ChangeLog index 878a885112..729729a301 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Dec 8 17:07:10 2007 Tanaka Akira + + * ruby.c (proc_options): make rb_raise format as a string literal to + avoid warning. + Sat Dec 8 16:18:16 2007 Tanaka Akira * re.c (rb_reg_check_preprocess): new function for validating regexp diff --git a/ruby.c b/ruby.c index 72602db016..486780467b 100644 --- a/ruby.c +++ b/ruby.c @@ -856,16 +856,16 @@ proc_options(int argc, char **argv, struct cmdline_options *opt) default: { - const char *format; if (ISPRINT(*s)) { - format = - "invalid option -%c (-h will show valid options)"; + rb_raise(rb_eRuntimeError, + "invalid option -%c (-h will show valid options)", + (int)(unsigned char)*s); } else { - format = - "invalid option -\\%03o (-h will show valid options)"; + rb_raise(rb_eRuntimeError, + "invalid option -\\%03o (-h will show valid options)", + (int)(unsigned char)*s); } - rb_raise(rb_eRuntimeError, format, (int)(unsigned char)*s); } goto switch_end;