Double warning with perl -we '\&$x'
authorVincent Pit <perl@profvince.com>
Thu, 20 Mar 2008 12:06:47 +0000 (13:06 +0100)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 20 Mar 2008 15:55:19 +0000 (15:55 +0000)
From: "Vincent Pit" <perl@profvince.com>
Message-ID: <38561.147.210.17.175.1206011207.squirrel@147.210.17.175>

p4raw-id: //depot/perl@33544

sv.c
t/lib/warnings/9uninit

diff --git a/sv.c b/sv.c
index 4d7f32d..603cb3b 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -7910,7 +7910,7 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **const st, GV **const gvp, const I32 lref)
            LEAVE;
            if (!GvCVu(gv))
                Perl_croak(aTHX_ "Unable to create sub named \"%"SVf"\"",
-                          SVfARG(sv));
+                          SVfARG(SvOK(sv) ? sv : &PL_sv_no));
        }
        return GvCVu(gv);
     }
index bbaba19..9316dc8 100644 (file)
@@ -1070,8 +1070,6 @@ reset $m1;
 reset $g1;
 EXPECT
 Use of uninitialized value $m1 in subroutine dereference at - line 5.
-Use of uninitialized value $m1 in subroutine dereference at - line 5.
-Use of uninitialized value $g1 in subroutine dereference at - line 6.
 Use of uninitialized value $g1 in subroutine dereference at - line 6.
 Use of uninitialized value $m1 in splice at - line 9.
 Use of uninitialized value $g1 in splice at - line 9.