In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/ddc3d23f07be7fca9d2ab2651ea35d86340bb5ea?hp=afa691d53d5d3906a2a0b84272bfb2e9674ff41b>
- Log ----------------------------------------------------------------- commit ddc3d23f07be7fca9d2ab2651ea35d86340bb5ea Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Nov 14 18:16:18 2014 -0800 Make $/=-1 warning default like other dep warnings M mg.c M pod/perldiag.pod M t/lib/warnings/mg commit 6166628574dae40085161a01aa9bde2879fa4106 Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Nov 14 18:13:17 2014 -0800 Fold t/lib/warnings/irs into mg It took me a while to find these tests. Most of these tests are arranged by which C file they occur in. (These warning tests were originally added to make sure all warnings in all C files get tested.) M MANIFEST D t/lib/warnings/irs M t/lib/warnings/mg commit 7b0a86d0baec42495d9e01259cab23a86784c441 Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Nov 14 18:06:38 2014 -0800 t/lib/warnings/mg: Remove comment The warning this refers to was removed (or moved to perl5db.pl) in commit bbdae7b29367. M t/lib/warnings/mg ----------------------------------------------------------------------- Summary of changes: MANIFEST | 1 - mg.c | 2 +- pod/perldiag.pod | 2 +- t/lib/warnings/irs | 14 -------------- t/lib/warnings/mg | 24 ++++++++++++++++++++---- 5 files changed, 22 insertions(+), 21 deletions(-) delete mode 100644 t/lib/warnings/irs diff --git a/MANIFEST b/MANIFEST index cb992f1..958aaca 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5052,7 +5052,6 @@ t/lib/warnings/doio Tests for doio.c for warnings.t t/lib/warnings/doop Tests for doop.c for warnings.t t/lib/warnings/gv Tests for gv.c for warnings.t t/lib/warnings/hv Tests for hv.c for warnings.t -t/lib/warnings/irs Tests for $/ for warnings.t t/lib/warnings/malloc Tests for malloc.c for warnings.t t/lib/warnings/mg Tests for mg.c for warnings.t t/lib/warnings/op Tests for op.c for warnings.t diff --git a/mg.c b/mg.c index 4524d01..c49b146 100644 --- a/mg.c +++ b/mg.c @@ -2791,7 +2791,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) IV val= SvIV(referent); if (val <= 0) { tmpsv= &PL_sv_undef; - Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), + Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED), "Setting $/ to a reference to %s as a form of slurp is deprecated, treating as undef", SvIV(SvRV(sv)) < 0 ? "a negative integer" : "zero" ); diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 0db7123..3ba649f 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -5222,7 +5222,7 @@ L<perlfunc/setsockopt>. =item Setting $/ to a reference to %s as a form of slurp is deprecated, treating as undef -(W deprecated) You assigned a reference to a scalar to C<$/> where the +(D deprecated) You assigned a reference to a scalar to C<$/> where the referenced item is not a positive integer. In older perls this B<appeared> to work the same as setting it to C<undef> but was in fact internally different, less efficient and with very bad luck could have resulted in diff --git a/t/lib/warnings/irs b/t/lib/warnings/irs deleted file mode 100644 index 9e1d3de..0000000 --- a/t/lib/warnings/irs +++ /dev/null @@ -1,14 +0,0 @@ -Test warnings related to $/ -__END__ --w -# warnable code, warnings enabled via command line switch -$/ = \0; -EXPECT -Setting $/ to a reference to zero as a form of slurp is deprecated, treating as undef at - line 3. -######## --w -# warnable code, warnings enabled via command line switch -$/ = \-1; -EXPECT -Setting $/ to a reference to a negative integer as a form of slurp is deprecated, treating as undef at - line 3. - diff --git a/t/lib/warnings/mg b/t/lib/warnings/mg index 7eb8428..348f9b2 100644 --- a/t/lib/warnings/mg +++ b/t/lib/warnings/mg @@ -3,13 +3,11 @@ No such signal: SIG%s $SIG{FRED} = sub {} + Setting $/ to a reference to zero as a form of slurp is deprecated, treating as undef + SIG%s handler \"%s\" not defined. $SIG{"INT"} = "ok3"; kill "INT",$$; - Mandatory Warnings TODO - ------------------ - Can't break at that line [magic_setdbline] - __END__ # mg.c use warnings 'signal' ; @@ -23,6 +21,24 @@ $SIG{FRED} = sub {}; EXPECT ######## +-w +# warnable code, warnings enabled via command line switch +$/ = \0; +EXPECT +Setting $/ to a reference to zero as a form of slurp is deprecated, treating as undef at - line 3. +######## +-w +# warnable code, warnings enabled via command line switch +$/ = \-1; +EXPECT +Setting $/ to a reference to a negative integer as a form of slurp is deprecated, treating as undef at - line 3. +######## +$/ = \-1; +no warnings 'deprecated'; +$/ = \-1; +EXPECT +Setting $/ to a reference to a negative integer as a form of slurp is deprecated, treating as undef at - line 1. +######## # mg.c use warnings 'signal' ; if ($^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS') { -- Perl5 Master Repository