Change 33745 by [EMAIL PROTECTED] on 2008/04/25 03:30:37

        Integrate:
        [ 32910]
        Remove the warning "v-string in require/use non portable"
        
        [ 32918]
        Add DEBUG_LEAKING_SCALARS_ABORT, to call abort() if any scalars leak,
        or are freed too many times.
        
        [ 32928]
        Only code paths in hv_store either XSRETURN_NO or XSRETURN_YES.
        Change the prototype to return void, remove the output to RETVAL
        (which isn't set anyway), and fix a typo in the code.

Affected files ...

... //depot/maint-5.10/perl/ext/B/B/Deparse.pm#5 integrate
... //depot/maint-5.10/perl/ext/Hash/Util/Util.xs#2 integrate
... //depot/maint-5.10/perl/perl.c#9 integrate
... //depot/maint-5.10/perl/pod/perldiag.pod#2 integrate
... //depot/maint-5.10/perl/pod/perlfunc.pod#5 integrate
... //depot/maint-5.10/perl/pp_ctl.c#10 integrate
... //depot/maint-5.10/perl/sv.c#12 integrate
... //depot/maint-5.10/perl/t/lib/warnings/pp_ctl#2 integrate

Differences ...

==== //depot/maint-5.10/perl/ext/B/B/Deparse.pm#5 (text) ====
Index: perl/ext/B/B/Deparse.pm
--- perl/ext/B/B/Deparse.pm#4~33722~    2008-04-22 07:32:01.000000000 -0700
+++ perl/ext/B/B/Deparse.pm     2008-04-24 20:30:37.000000000 -0700
@@ -1457,8 +1457,7 @@
     'open<' => 1,
     'open>' => 1,
     ':'     => 1,
-    'v_string' => 1,
-    );
+);
 
 sub declare_hinthash {
     my ($from, $to, $indent) = @_;

==== //depot/maint-5.10/perl/ext/Hash/Util/Util.xs#2 (text) ====
Index: perl/ext/Hash/Util/Util.xs
--- perl/ext/Hash/Util/Util.xs#1~32694~ 2007-12-22 01:23:09.000000000 -0800
+++ perl/ext/Hash/Util/Util.xs  2008-04-24 20:30:37.000000000 -0700
@@ -87,7 +87,7 @@
             XPUSHs( key );
         }
 
-SV*
+void
 hv_store(hvref, key, val)
        SV* hvref
        SV* key
@@ -98,7 +98,7 @@
     CODE:
     {
        if (!SvROK(hvref) || SvTYPE(SvRV(hvref)) != SVt_PVHV)
-          croak("First argument to alias_hv() must be a hash reference");
+          croak("First argument to hv_store() must be a hash reference");
        hv = (HV*)SvRV(hvref);
         SvREFCNT_inc(val);
        if (!hv_store_ent(hv, key, val, 0)) {
@@ -107,7 +107,5 @@
        } else {
            XSRETURN_YES;
        }
-
     }
-    OUTPUT:
-        RETVAL
\ No newline at end of file
+

==== //depot/maint-5.10/perl/perl.c#9 (text) ====
Index: perl/perl.c
--- perl/perl.c#8~33742~        2008-04-24 19:21:31.000000000 -0700
+++ perl/perl.c 2008-04-24 20:30:37.000000000 -0700
@@ -1257,6 +1257,10 @@
     }
 #endif
 #endif
+#ifdef DEBUG_LEAKING_SCALARS_ABORT
+    if (PL_sv_count)
+       abort();
+#endif
     PL_sv_count = 0;
 
 #ifdef PERL_DEBUG_READONLY_OPS

==== //depot/maint-5.10/perl/pod/perldiag.pod#2 (text) ====
Index: perl/pod/perldiag.pod
--- perl/pod/perldiag.pod#1~32694~      2007-12-22 01:23:09.000000000 -0800
+++ perl/pod/perldiag.pod       2008-04-24 20:30:37.000000000 -0700
@@ -4935,18 +4935,6 @@
 (W misc) The version string contains invalid characters at the end, which
 are being ignored.
 
-=item v-string in use/require is non-portable
-
-(W portable) The use of v-strings is non-portable to older, pre-5.6, Perls.
-If you want your scripts to be backward portable, use the floating
-point version number: for example, instead of C<use 5.6.1> say
-C<use 5.006_001>. This of course won't make older Perls suddenly start
-understanding newer features, but at least they will show a sensible
-error message indicating the required minimum version.
-
-This warning is suppressed if the C<use 5.x.y> is preceded by a
-C<use 5.006> (see C<use VERSION> in L<perlfunc/use>).
-
 =item Warning: something's wrong
 
 (W) You passed warn() an empty string (the equivalent of C<warn "">) or

==== //depot/maint-5.10/perl/pod/perlfunc.pod#5 (text) ====
Index: perl/pod/perlfunc.pod
--- perl/pod/perlfunc.pod#4~33729~      2008-04-22 11:51:34.000000000 -0700
+++ perl/pod/perlfunc.pod       2008-04-24 20:30:37.000000000 -0700
@@ -6880,22 +6880,16 @@
 
 Specifying VERSION as a literal of the form v5.6.1 should generally be
 avoided, because it leads to misleading error messages under earlier
-versions of Perl that do not support this syntax.  The equivalent numeric
-version should be used instead.
-
-Alternatively, you can use a numeric version C<use 5.006> followed by a
-v-string version like C<use v5.10.1>, to avoid the unintuitive C<use
-5.010_001>. (older perl versions fail gracefully at the first C<use>,
-later perl versions understand the v-string syntax in the second).
+versions of Perl (that is, prior to 5.6.0) that do not support this
+syntax.  The equivalent numeric version should be used instead.
 
     use v5.6.1;                # compile time version check
     use 5.6.1;         # ditto
     use 5.006_001;     # ditto; preferred for backwards compatibility
-    use 5.006; use 5.6.1;      # ditto, for compatibility and readability
 
 This is often useful if you need to check the current Perl version before
-C<use>ing library modules that have changed in incompatible ways from
-older versions of Perl.  (We try not to do this more than we have to.)
+C<use>ing library modules that won't work with older versions of Perl.
+(We try not to do this more than we have to.)
 
 Also, if the specified perl version is greater than or equal to 5.9.5,
 C<use VERSION> will also load the C<feature> pragma and enable all

==== //depot/maint-5.10/perl/pp_ctl.c#10 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#9~33732~      2008-04-22 12:53:49.000000000 -0700
+++ perl/pp_ctl.c       2008-04-24 20:30:37.000000000 -0700
@@ -3078,14 +3078,6 @@
 
     sv = POPs;
     if ( (SvNIOKp(sv) || SvVOK(sv)) && PL_op->op_type != OP_DOFILE) {
-       if ( SvVOK(sv) && ckWARN(WARN_PORTABLE) ) {     /* require v5.6.1 */
-           HV * hinthv = GvHV(PL_hintgv);
-           SV ** ptr = NULL;
-           if (hinthv) ptr = hv_fetchs(hinthv, "v_string", FALSE);
-           if ( !(ptr && *ptr && SvIOK(*ptr) && SvIV(*ptr)) )
-               Perl_warner(aTHX_ packWARN(WARN_PORTABLE),
-                        "v-string in use/require non-portable");
-       }
        sv = new_version(sv);
        if (!sv_derived_from(PL_patchlevel, "version"))
            upg_version(PL_patchlevel, TRUE);
@@ -3137,26 +3129,14 @@
 
         /* We do this only with use, not require. */
        if (PL_compcv &&
-         /* If we request a version >= 5.6.0, then v-string are OK
-            so set $^H{v_string} to suppress the v-string warning */
-           vcmp(sv, sv_2mortal(upg_version(newSVnv(5.006), FALSE))) >= 0) {
-         HV * hinthv = GvHV(PL_hintgv);
-         if( hinthv ) {
-             SV *hint = newSViv(1);
-             (void)hv_stores(hinthv, "v_string", hint);
-             /* This will call through to Perl_magic_sethint() which in turn
-                sets PL_hints correctly.  */
-             SvSETMAGIC(hint);
-         }
          /* If we request a version >= 5.9.5, load feature.pm with the
           * feature bundle that corresponds to the required version. */
-         if (vcmp(sv, sv_2mortal(upg_version(newSVnv(5.009005), FALSE))) >= 0) 
{
+               vcmp(sv, sv_2mortal(upg_version(newSVnv(5.009005), FALSE))) >= 
0) {
            SV *const importsv = vnormal(sv);
            *SvPVX_mutable(importsv) = ':';
            ENTER;
            Perl_load_module(aTHX_ 0, newSVpvs("feature"), NULL, importsv, 
NULL);
            LEAVE;
-         }
        }
 
        RETPUSHYES;

==== //depot/maint-5.10/perl/sv.c#12 (text) ====
Index: perl/sv.c
--- perl/sv.c#11~33742~ 2008-04-24 19:21:31.000000000 -0700
+++ perl/sv.c   2008-04-24 20:30:37.000000000 -0700
@@ -5351,6 +5351,9 @@
   #endif
 #endif
        }
+#ifdef DEBUG_LEAKING_SCALARS_ABORT
+       abort();
+#endif
        return;
     }
     if (--(SvREFCNT(sv)) > 0)

==== //depot/maint-5.10/perl/t/lib/warnings/pp_ctl#2 (text) ====
Index: perl/t/lib/warnings/pp_ctl
--- perl/t/lib/warnings/pp_ctl#1~32694~ 2007-12-22 01:23:09.000000000 -0800
+++ perl/t/lib/warnings/pp_ctl  2008-04-24 20:30:37.000000000 -0700
@@ -222,18 +222,6 @@
 Use of uninitialized value $foo in print at (eval 1) line 1.
 ########
 # pp_ctl.c
-use warnings 'portable';
-eval 'use 5.6.1';
-EXPECT
-v-string in use/require non-portable at (eval 1) line 2.
-########
-# pp_ctl.c
-use warnings 'portable';
-eval 'use v5.6.1';
-EXPECT
-v-string in use/require non-portable at (eval 1) line 2.
-########
-# pp_ctl.c
 use warnings;
 {
     no warnings;
@@ -245,15 +233,3 @@
 use warnings;
 eval 'use 5.006; use 5.10.0';
 EXPECT
-########
-# pp_ctl.c
-use warnings;
-eval '{use 5.006;} use 5.10.0';
-EXPECT
-v-string in use/require non-portable at (eval 1) line 2.
-########
-# pp_ctl.c
-use warnings;
-eval 'use vars; use 5.10.0';
-EXPECT
-v-string in use/require non-portable at (eval 1) line 2.
End of Patch.

Reply via email to