ruby-changes:46334
From: nobu <ko1@a...>
Date: Sat, 22 Apr 2017 17:32:38 +0900 (JST)
Subject: [ruby-changes:46334] nobu:r58448 (trunk): parse.y: fix compile_error format
nobu 2017-04-22 17:32:33 +0900 (Sat, 22 Apr 2017) New Revision: 58448 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58448 Log: parse.y: fix compile_error format * parse.y (ripper_compile_error, parser_compile_error): declare as PRINTF_ARGS attribute. * parse.y (id_is_var_gen): fix format specifier for string value. Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 58447) +++ parse.y (revision 58448) @@ -843,7 +843,7 @@ static ID id_warn, id_warning, id_gets; https://github.com/ruby/ruby/blob/trunk/parse.y#L843 # else # define WARNING_CALL rb_funcall # endif -static void ripper_compile_error(struct parser_params*, const char *fmt, ...); +PRINTF_ARGS(static void ripper_compile_error(struct parser_params*, const char *fmt, ...), 2, 3); # define compile_error ripper_compile_error # define PARSER_ARG parser, #else @@ -857,7 +857,7 @@ static void ripper_compile_error(struct https://github.com/ruby/ruby/blob/trunk/parse.y#L857 # define WARNING_ARGS(fmt,n) WARN_ARGS(fmt,n) # define WARNING_ARGS_L(l,fmt,n) WARN_ARGS_L(l,fmt,n) # define WARNING_CALL rb_compile_warning -static void parser_compile_error(struct parser_params*, const char *fmt, ...); +PRINTF_ARGS(static void parser_compile_error(struct parser_params*, const char *fmt, ...), 2, 3); # define compile_error parser_compile_error # define PARSER_ARG parser, #endif @@ -9001,7 +9001,7 @@ id_is_var_gen(struct parser_params *pars https://github.com/ruby/ruby/blob/trunk/parse.y#L9001 return 0; } } - compile_error(PARSER_ARG "identifier %s is not valid to get", rb_id2str(id)); + compile_error(PARSER_ARG "identifier %"PRIsVALUE" is not valid to get", rb_id2str(id)); return 0; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/