This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In Perl_pad_check_dup(), use sv rather than name for diagnostics.
authorNicholas Clark <nick@ccl4.org>
Mon, 9 Nov 2009 15:08:53 +0000 (15:08 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 9 Nov 2009 15:11:56 +0000 (15:11 +0000)
It already knows its length, and it will be UTF-8 clean in the future.

pad.c

diff --git a/pad.c b/pad.c
index ae69c9e..becbdc9 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -568,9 +568,9 @@ Perl_pad_check_dup(pTHX_ const char *name, bool is_our, const HV *ourstash)
            if (is_our && (SvPAD_OUR(sv)))
                break; /* "our" masking "our" */
            Perl_warner(aTHX_ packWARN(WARN_MISC),
-               "\"%s\" variable %s masks earlier declaration in same %s",
+               "\"%s\" variable %"SVf" masks earlier declaration in same %s",
                (is_our ? "our" : PL_parser->in_my == KEY_my ? "my" : "state"),
-               name,
+               sv,
                (COP_SEQ_RANGE_HIGH(sv) == PAD_MAX ? "scope" : "statement"));
            --off;
            break;
@@ -588,7 +588,7 @@ Perl_pad_check_dup(pTHX_ const char *name, bool is_our, const HV *ourstash)
                && strEQ(name, SvPVX_const(sv)))
            {
                Perl_warner(aTHX_ packWARN(WARN_MISC),
-                   "\"our\" variable %s redeclared", name);
+                   "\"our\" variable %"SVf" redeclared", sv);
                if ((I32)off <= PL_comppad_name_floor)
                    Perl_warner(aTHX_ packWARN(WARN_MISC),
                        "\t(Did you mean \"local\" instead of \"our\"?)\n");