diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 9b7c9842f8..b03c3cba00 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -2512,6 +2512,8 @@ rb_scan_args_set(int argc, const VALUE *argv, int f_var, int f_hash, int f_block, VALUE *vars[], char *fmt, int varc)); +PRINTF_ARGS(void rb_warn_deprecated(const char *fmt, const char *suggest, ...), 1, 3); + inline int rb_scan_args_set(int argc, const VALUE *argv, int n_lead, int n_opt, int n_trail, @@ -2569,7 +2571,7 @@ rb_scan_args_set(int argc, const VALUE *argv, if (!keyword_given) { /* Warn if treating positional as keyword, as in Ruby 3, this will be an error */ - rb_warn("Using the last argument as keyword parameters is deprecated"); + rb_warn_deprecated("Using the last argument as keyword parameters", NULL); } argc--; } @@ -2584,7 +2586,7 @@ rb_scan_args_set(int argc, const VALUE *argv, } else if (f_hash && keyword_given && n_mand == argc) { /* Warn if treating keywords as positional, as in Ruby 3, this will be an error */ - rb_warn("Passing the keyword argument as the last hash parameter is deprecated"); + rb_warn_deprecated("Passing the keyword argument as the last hash parameter", NULL); } } if (f_hash && n_mand > 0 && n_mand == argc+1 && empty_keyword_given) { @@ -2593,7 +2595,7 @@ rb_scan_args_set(int argc, const VALUE *argv, ptr[argc] = rb_hash_new(); argc++; *(&argv) = ptr; - rb_warn("Passing the keyword argument as the last hash parameter is deprecated"); + rb_warn_deprecated("Passing the keyword argument as the last hash parameter", NULL); }