From ed0487bc24fac15446bbf533f0325aa7e4b808fa Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 8 Dec 2007 08:11:52 +0000 Subject: * ruby.c (proc_options): make rb_raise format as a string literal to avoid warning. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ruby.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 878a88511..729729a30 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 72602db01..486780467 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; -- cgit