summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-22 08:32:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-22 08:32:33 +0000
commit27ed9f1d290a6ff6b788976ea7139c608920ee1e (patch)
tree9b8a0f8d8edcb75956ca05efedd8822b51ee5745 /parse.y
parent9c5c31c8b70106989a218e41935c0ab75f631b34 (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index a55d27982d..fe366d027b 100644
--- a/parse.y
+++ b/parse.y
@@ -843,7 +843,7 @@ static ID id_warn, id_warning, id_gets;
# 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 parser_params*, const char *fmt, ...);
# 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 *parser, ID id)
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;
}