Project

General

Profile

Bug #16901 ยป use-rb_warn_deprecated-instead-of-rb_warn-2.diff

update declaration position - znz (Kazuhiro NISHIYAMA), 05/20/2020 12:58 PM

View differences:

include/ruby/ruby.h
1957 1957
PRINTF_ARGS(void rb_sys_warning(const char*, ...), 1, 2);
1958 1958
/* reports always */
1959 1959
COLDFUNC PRINTF_ARGS(void rb_warn(const char*, ...), 1, 2);
1960
PRINTF_ARGS(void rb_warn_deprecated(const char *fmt, const char *suggest, ...), 1, 3);
1960 1961
PRINTF_ARGS(void rb_compile_warn(const char *, int, const char*, ...), 3, 4);
1961 1962

  
1962 1963
#define RB_BLOCK_CALL_FUNC_STRICT 1
......
2569 2570
                    if (!keyword_given) {
2570 2571
                        /* Warn if treating positional as keyword, as in Ruby 3,
2571 2572
                           this will be an error */
2572
                        rb_warn("Using the last argument as keyword parameters is deprecated");
2573
                        rb_warn_deprecated("Using the last argument as keyword parameters", NULL);
2573 2574
                    }
2574 2575
                    argc--;
2575 2576
                }
......
2584 2585
        }
2585 2586
        else if (f_hash && keyword_given && n_mand == argc) {
2586 2587
            /* Warn if treating keywords as positional, as in Ruby 3, this will be an error */
2587
            rb_warn("Passing the keyword argument as the last hash parameter is deprecated");
2588
            rb_warn_deprecated("Passing the keyword argument as the last hash parameter", NULL);
2588 2589
        }
2589 2590
    }
2590 2591
    if (f_hash && n_mand > 0 && n_mand == argc+1 && empty_keyword_given) {
......
2593 2594
        ptr[argc] = rb_hash_new();
2594 2595
        argc++;
2595 2596
        *(&argv) = ptr;
2596
        rb_warn("Passing the keyword argument as the last hash parameter is deprecated");
2597
        rb_warn_deprecated("Passing the keyword argument as the last hash parameter", NULL);
2597 2598
    }
2598 2599

  
2599 2600

  
internal.h
1549 1549
NORETURN(void rb_async_bug_errno(const char *,int));
1550 1550
const char *rb_builtin_type_name(int t);
1551 1551
const char *rb_builtin_class_name(VALUE x);
1552
PRINTF_ARGS(void rb_warn_deprecated(const char *fmt, const char *suggest, ...), 1, 3);
1553 1552
#ifdef RUBY_ENCODING_H
1554 1553
VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list);
1555 1554
PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3);