In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/04f745798a0e989d3948b52426ed936a1b2dfc51?hp=9b9923c633797a232ac871903c3c14833036aa28>
- Log ----------------------------------------------------------------- commit 04f745798a0e989d3948b52426ed936a1b2dfc51 Author: Father Chrysostomos <[email protected]> Date: Sun Jun 9 14:37:50 2013 -0700 perldiag: Tweak â'%c' allowed only after typesâ by adding âin %sâ to the end. Though strictly unnecessary, having more of the unvarying parts of the string displayed in perldiag is generally a good thing, and this also appeases diag.t. (The former is my main reason for the change, the latter incidental.) M pod/perldiag.pod M t/porting/diag.t commit 1ef9e4dd163392fd8589747b2f591cfb0e9c5eae Author: James E Keenan <[email protected]> Date: Sun May 26 04:52:00 2013 +0200 Bump version in Carp::Heavy. M dist/Carp/lib/Carp/Heavy.pm commit 79f8d0e810e1442ce47a0b1e112c5f2b83d637a2 Author: Brian Fraser <[email protected]> Date: Mon May 13 16:37:22 2013 -0300 Carp: Don't autovivify the CARP_NOT or ISA array In this situation: use Carp; package Foo; $CARP_NOT = 1; warn *{$Foo::{CARP_NOT}}{ARRAY} || 'undefined'; eval { Carp::croak(1) }; warn *{$Foo::{CARP_NOT}}{ARRAY} || 'undefined'; The second warn shows that Carp is autovivifying the ARRAY slot of the glob. This commit builds on the previous and checks that the array exists before trying to use it. M dist/Carp/lib/Carp.pm M dist/Carp/t/Carp.t commit 1a4f8f41aa38eebfdff591e350c60fd1832af3fb Author: Brian Fraser <[email protected]> Date: Mon May 13 15:57:18 2013 -0300 Carp: Stop polluting the caller's namespace if they lack @CARP_NOT or @ISA Turns out that this: perl -MCarp -le 'package Foo; eval { Carp::croak(1) }; print keys %Foo::;' Would leave two new symbols in Foo, CARP_NOT and ISA. This commit changes trusts_directly() to check if the symbols exists in the stash before using them. M dist/Carp/lib/Carp.pm M dist/Carp/t/Carp.t commit 9b3e256ba8b6c2c4da93505f20c594c38b97cb81 Author: Father Chrysostomos <[email protected]> Date: Sun Jun 9 12:00:32 2013 -0700 AUTHORS: Use tabs consistently Since this is not just a source file, but a file to be read by the public as is, we cannot mix tabs and spaces. M AUTHORS commit 86098e45b32c333f19e2264cd0060b9957b50e36 Author: Father Chrysostomos <[email protected]> Date: Sun Jun 9 11:27:17 2013 -0700 podcheck.t: Use scalar instead of array The contents of @thankful_diagnostics are never used, only the length. So it can simply be a scalar containing a count. M t/porting/podcheck.t ----------------------------------------------------------------------- Summary of changes: AUTHORS | 38 +++++++++++++++++++------------------- dist/Carp/lib/Carp.pm | 15 ++++++++++----- dist/Carp/lib/Carp/Heavy.pm | 2 +- dist/Carp/t/Carp.t | 20 +++++++++++++++++++- pod/perldiag.pod | 2 +- t/porting/diag.t | 1 - t/porting/podcheck.t | 10 +++++----- 7 files changed, 55 insertions(+), 33 deletions(-) diff --git a/AUTHORS b/AUTHORS index 10a9b99..521e941 100644 --- a/AUTHORS +++ b/AUTHORS @@ -18,8 +18,8 @@ A. Sinan Unur <[email protected]> Aaron Crane <[email protected]> Aaron B. Dossett <[email protected]> Aaron J. Mackey <[email protected]> -Aaron Trevena <[email protected]> -Augustina Blair <[email protected]> +Aaron Trevena <[email protected]> +Augustina Blair <[email protected]> Abe Timmerman <[email protected]> Abhijit Menon-Sen <[email protected]> Abigail <[email protected]> @@ -100,9 +100,9 @@ Anton Berezin <[email protected]> Anton Nikishaev <[email protected]> Anton Tagunov <[email protected]> Archer Sully <[email protected]> -Aristotle Pagaltzis <[email protected]> +Aristotle Pagaltzis <[email protected]> Arjen Laarhoven <[email protected]> -Arkturuz <[email protected]> +Arkturuz <[email protected]> Arne Ahrend <[email protected]> Arnold D. Robbins <[email protected]> Art Green <[email protected]> @@ -169,7 +169,7 @@ Brian Harrison <[email protected]> Brian Jepson <[email protected]> Brian Katzung Brian McCauley <[email protected]> -Brian Phillips <[email protected]> +Brian Phillips <[email protected]> Brian Reichert <[email protected]> Brian S. Cashman <[email protected]> Brian Strand <[email protected]> @@ -183,7 +183,7 @@ Calle Dybedahl <[email protected]> Campo Weijerman <[email protected]> Carl Eklof <[email protected]> Carl M. Fongheiser <[email protected]> -Carl Hayter <[email protected]> +Carl Hayter <[email protected]> Carl Witty <[email protected]> Cary D. Renzema <[email protected]> Casey R. Tweten <[email protected]> @@ -370,7 +370,7 @@ Eugene Alterman <[email protected]> Evan Miller <[email protected]> Fabien Tassin <[email protected]> Father Chrysostomos <[email protected]> -Felipe Gasper <[email protected]> +Felipe Gasper <[email protected]> Felix Gallo <[email protected]> Fergal Daly <[email protected]> Fingle Nark <[email protected]> @@ -533,7 +533,7 @@ Jeremy Madea <[email protected]> Jerome Abela <[email protected]> Jerrad Pierce <[email protected]> Jerry D. Hedden <[email protected]> -Jess Robinson <[email protected]> +Jess Robinson <[email protected]> Jesse Glick <[email protected]> Jesse Luehrs <[email protected]> Jesse Vincent <[email protected]> @@ -791,7 +791,7 @@ Michael H. Moran <[email protected]> Michael King <[email protected]> Michael Lemke <[email protected]> Michael Mahan <[email protected]> -Michael Parker <[email protected]> +Michael Parker <[email protected]> Michael Schroeder <[email protected]> Michael Somos <[email protected]> Michael Stevens <[email protected]> @@ -827,11 +827,11 @@ Neil Watkiss <[email protected]> Nicholas Clark <[email protected]> Nicholas Oxhøj Nicholas Perez <[email protected]> -Nick Cleaton <[email protected]> +Nick Cleaton <[email protected]> Nick Duffek Nick Gianniotis Nick Ing-Simmons -Nick Johnston <[email protected]> +Nick Johnston <[email protected]> Nick Williams <[email protected]> Nicolas Kaiser <[email protected]> Nigel Sandever <[email protected]> @@ -863,7 +863,7 @@ Patrick Donelan <[email protected]> Patrick Dugnolle <[email protected]> Patrick Hayes <[email protected]> Patrick O'Brien <[email protected]> -Patrik Hägglund <[email protected]> +Patrik Hägglund <[email protected]> Pau Amma <[email protected]> Paul A Sand <[email protected]> Paul Boven <[email protected]> @@ -887,7 +887,7 @@ Pavel KaÅkovský <[email protected]> Pavel Zakouril <[email protected]> Pedro Felipe Horrillo Guerra <[email protected]> Per Einar Ellefsen <[email protected]> -Perlover <[email protected]> +Perlover <[email protected]> Peter BARABAS Pete Peterson <[email protected]> Peter Chines <[email protected]> @@ -899,7 +899,7 @@ Peter J. Farley III <[email protected]> Peter J. Holzer <[email protected]> Peter Jaspers-Fayer Peter John Acklam <[email protected]> -Peter Martini <[email protected]> +Peter Martini <[email protected]> Peter O'Gorman <[email protected]> Peter Prymmer <[email protected]> Peter Rabbitson <[email protected]> @@ -1001,7 +1001,7 @@ Sam Tregar <[email protected]> Sam Vilain <[email protected]> Samuel Thibault <[email protected]> Samuli Kärkkäinen <[email protected]> -Sawyer X <[email protected]> +Sawyer X <[email protected]> Schuyler Erle <[email protected]> Scott A Crosby <[email protected]> Scott Bronson <[email protected]> @@ -1037,7 +1037,7 @@ Simon Glover <[email protected]> Simon Leinen Simon Parsons <[email protected]> Simon Schubert <[email protected]> -Sinan Unur <[email protected]> +Sinan Unur <[email protected]> Sisyphus <[email protected]> Slaven Rezic <[email protected]> Smylers <[email protected]> @@ -1078,7 +1078,7 @@ Steven N. Hirsch <[email protected]> Steven Parkes <[email protected]> Steven Schubiger <[email protected]> Stian Seeberg <[email protected]> -Sullivan Beck <[email protected]> +Sullivan Beck <[email protected]> Sven Strickroth <[email protected]> Sven Verdoolaege <[email protected]> SynaptiCAD, Inc. <[email protected]> @@ -1112,7 +1112,7 @@ Tim Witham <[email protected]> Timothe Litt <[email protected]> Timur I. Bakeyev <[email protected]> Tkil <[email protected]> -Tobias Leich <[email protected]> +Tobias Leich <[email protected]> Todd C. Miller <[email protected]> Todd Rinaldo <[email protected]> Todd T. Fries <[email protected]> @@ -1185,6 +1185,6 @@ Yuval Kogman <[email protected]> Yves Orton <[email protected]> Zachary Miller <[email protected]> Zefram <[email protected]> -Zsbán Ambrus <[email protected]> +Zsbán Ambrus <[email protected]> Zbynek Vyskovsky <[email protected]> Ãvar Arnfjörð Bjarmason <[email protected]> diff --git a/dist/Carp/lib/Carp.pm b/dist/Carp/lib/Carp.pm index 69caac3..bb557dd 100644 --- a/dist/Carp/lib/Carp.pm +++ b/dist/Carp/lib/Carp.pm @@ -24,7 +24,7 @@ BEGIN { } } -our $VERSION = '1.29'; +our $VERSION = '1.30'; our $MaxEvalLen = 0; our $Verbose = 0; @@ -431,10 +431,15 @@ sub trusts { sub trusts_directly { my $class = shift; no strict 'refs'; - no warnings 'once'; - return @{"$class\::CARP_NOT"} - ? @{"$class\::CARP_NOT"} - : @{"$class\::ISA"}; + my $stash = \%{"$class\::"}; + for my $var (qw/ CARP_NOT ISA /) { + # Don't try using the variable until we know it exists, + # to avoid polluting the caller's namespace. + if ( $stash->{$var} && *{$stash->{$var}}{ARRAY} && @{$stash->{$var}} ) { + return @{$stash->{$var}} + } + } + return; } if(!defined($warnings::VERSION) || diff --git a/dist/Carp/lib/Carp/Heavy.pm b/dist/Carp/lib/Carp/Heavy.pm index 283b09b..db8b453 100644 --- a/dist/Carp/lib/Carp/Heavy.pm +++ b/dist/Carp/lib/Carp/Heavy.pm @@ -2,7 +2,7 @@ package Carp::Heavy; use Carp (); -our $VERSION = '1.29'; +our $VERSION = '1.30'; 1; diff --git a/dist/Carp/t/Carp.t b/dist/Carp/t/Carp.t index f7c226a..f51bd11 100644 --- a/dist/Carp/t/Carp.t +++ b/dist/Carp/t/Carp.t @@ -3,7 +3,7 @@ no warnings "once"; use Config; use IPC::Open3 1.0103 qw(open3); -use Test::More tests => 61; +use Test::More tests => 63; sub runperl { my(%args) = @_; @@ -463,6 +463,24 @@ SKIP: ); } +{ + package Foo::No::CARP_NOT; + eval { Carp::croak(1) }; + ::is_deeply( + [ keys %Foo::No::CARP_NOT:: ], + [], + "Carp doesn't create CARP_NOT or ISA in the caller if they don't exist" + ); + + package Foo::No::Autovivify; + $CARP_NOT = 1; + eval { Carp::croak(1) }; + ::ok( + !defined *{$Foo::No::Autovivify::{CARP_NOT}}{ARRAY}, + "Carp doesn't autovivify the CARP_NOT or ISA arrays if the globs exists but they lack the ARRAY slot" + ); +} + # New tests go here # line 1 "A" diff --git a/pod/perldiag.pod b/pod/perldiag.pod index a228d23..a0893d8 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -54,7 +54,7 @@ L<perlfunc/accept>. (X) You can't allocate more than 64K on an MS-DOS machine. -=item '%c' allowed only after types %s +=item '%c' allowed only after types %s in %s (F) The modifiers '!', '<' and '>' are allowed in pack() or unpack() only after certain types. See L<perlfunc/pack>. diff --git a/t/porting/diag.t b/t/porting/diag.t index 104c195..ebf9b48 100644 --- a/t/porting/diag.t +++ b/t/porting/diag.t @@ -457,7 +457,6 @@ sub check_message { __DATA__ Malformed UTF-8 character (unexpected non-continuation byte 0x%x, immediately after start byte 0x%x) -'%c' allowed only after types %s in %s bad top format reference Cannot apply "%s" in non-PerlIO perl Can't %s big-endian %ss on this diff --git a/t/porting/podcheck.t b/t/porting/podcheck.t index 4b4c893..a0f56ae 100644 --- a/t/porting/podcheck.t +++ b/t/porting/podcheck.t @@ -1704,7 +1704,7 @@ foreach my $filename (@files) { skip($skip, 1) if $skip; my @diagnostics; - my @thankful_diagnostics; + my $thankful_diagnostics = 0; my $indent = ' '; my $total_known = 0; @@ -1737,7 +1737,7 @@ foreach my $filename (@files) { $files_with_unknown_issues{$filename} = 1; } elsif ($problem_count < $known_problems{$canonical}{$message}) { $diagnostic = output_thanks($filename, $known_problems{$canonical}{$message}, $problem_count, $message); - push @thankful_diagnostics, $diagnostic; + $thankful_diagnostics++; } push @diagnostics, $diagnostic if $diagnostic; } @@ -1751,18 +1751,18 @@ foreach my $filename (@files) { next if $known_problems{$canonical}{$message} < 0; # Preserve negs my $diagnostic = output_thanks($filename, $known_problems{$canonical}{$message}, 0, $message); push @diagnostics, $diagnostic if $diagnostic; - push @thankful_diagnostics, $diagnostic if $diagnostic; + $thankful_diagnostics++ if $diagnostic; } my $output = "POD of $filename"; $output .= ", excluding $total_known not shown known potential problems" if $total_known; - if (@diagnostics && @diagnostics == @thankful_diagnostics) { + if (@diagnostics && @diagnostics == $thankful_diagnostics) { # Output fixed issues as passing to-do tests, so they do not # cause failures, but t/harness still flags them. $output .= " # TODO" } - ok(@diagnostics == @thankful_diagnostics, $output); + ok(@diagnostics == $thankful_diagnostics, $output); if (@diagnostics) { note(join "", @diagnostics, "See end of this test output for your options on silencing this"); -- Perl5 Master Repository
