Change 33088 by [EMAIL PROTECTED] on 2008/01/28 13:10:48

        Make lc/uc/lcfirst/ucfirst warn when passed undef.
        Naive implementation.

Affected files ...

... //depot/perl/lib/utf8_heavy.pl#53 edit
... //depot/perl/pp.c#620 edit
... //depot/perl/t/lib/warnings/9uninit#18 edit

Differences ...

==== //depot/perl/lib/utf8_heavy.pl#53 (text) ====
Index: perl/lib/utf8_heavy.pl
--- perl/lib/utf8_heavy.pl#52~31450~    2007-06-23 03:14:43.000000000 -0700
+++ perl/lib/utf8_heavy.pl      2008-01-28 05:10:48.000000000 -0800
@@ -137,10 +137,12 @@
             print STDERR "canonical = $canonical\n" if DEBUG;
 
             require "unicore/Canonical.pl";
+           { no warnings "uninitialized";
             if (my $base = ($utf8::Canonical{$canonical} || $utf8::Canonical{ 
lc $utf8::PropertyAlias{$canonical} })) {
                 $file = "unicore/lib/gc_sc/$base.pl";
                 last GETFILE;
             }
+            }
 
            ##
            ## See if it's a user-level "To".

==== //depot/perl/pp.c#620 (text) ====
Index: perl/pp.c
--- perl/pp.c#619~32971~        2008-01-13 12:58:56.000000000 -0800
+++ perl/pp.c   2008-01-28 05:10:48.000000000 -0800
@@ -3528,6 +3528,8 @@
     if (SvOK(source)) {
        s = (const U8*)SvPV_nomg_const(source, slen);
     } else {
+       if (ckWARN(WARN_UNINITIALIZED))
+           report_uninit(source);
        s = (const U8*)"";
        slen = 0;
     }
@@ -3652,6 +3654,8 @@
        if (SvOK(source)) {
            s = (const U8*)SvPV_nomg_const(source, len);
        } else {
+           if (ckWARN(WARN_UNINITIALIZED))
+               report_uninit(source);
            s = (const U8*)"";
            len = 0;
        }
@@ -3752,6 +3756,8 @@
        if (SvOK(source)) {
            s = (const U8*)SvPV_nomg_const(source, len);
        } else {
+           if (ckWARN(WARN_UNINITIALIZED))
+               report_uninit(source);
            s = (const U8*)"";
            len = 0;
        }

==== //depot/perl/t/lib/warnings/9uninit#18 (text) ====
Index: perl/t/lib/warnings/9uninit
--- perl/t/lib/warnings/9uninit#17~32969~       2008-01-12 14:20:39.000000000 
-0800
+++ perl/t/lib/warnings/9uninit 2008-01-28 05:10:48.000000000 -0800
@@ -925,7 +925,6 @@
 $v = chr;
 $v = chr $m1;
 
-# XXX these functions don't warn!
 $v = ucfirst;
 $v = ucfirst $m1;
 $v = lcfirst;
@@ -944,8 +943,16 @@
 Use of uninitialized value $m1 in ord at - line 8.
 Use of uninitialized value $_ in chr at - line 9.
 Use of uninitialized value $m1 in chr at - line 10.
-Use of uninitialized value $_ in quotemeta at - line 22.
-Use of uninitialized value $m1 in quotemeta at - line 23.
+Use of uninitialized value $_ in ucfirst at - line 12.
+Use of uninitialized value $m1 in ucfirst at - line 13.
+Use of uninitialized value $_ in lcfirst at - line 14.
+Use of uninitialized value $m1 in lcfirst at - line 15.
+Use of uninitialized value $_ in uc at - line 16.
+Use of uninitialized value $m1 in uc at - line 17.
+Use of uninitialized value $_ in lc at - line 18.
+Use of uninitialized value $m1 in lc at - line 19.
+Use of uninitialized value $_ in quotemeta at - line 21.
+Use of uninitialized value $m1 in quotemeta at - line 22.
 ########
 use warnings 'uninitialized';
 my ($m1, $v1, $v2, $v3, $v4);
End of Patch.

Reply via email to