Front page | perl.perl5.porters |
Postings from January 2012
Re: [perl.git] branch blead, updated. v5.15.6-559-g604a99b
From:
Nicholas Clark
Date:
January 16, 2012 12:51
Subject:
Re: [perl.git] branch blead, updated. v5.15.6-559-g604a99b
Message ID:
20120116205136.GL17934@plum.flirble.org
Interesting:
On Mon, Jan 16, 2012 at 09:23:25PM +0100, Nicholas Clark wrote:
> In perl.git, the branch blead has been updated
>
> <http://perl5.git.perl.org/perl.git/commitdiff/604a99bd464c92d77ef2476ab9779cddb72339c4?hp=86e2f32949f588e0df48328ed7dfb2e90d8b142b>
>
> - Log -----------------------------------------------------------------
> commit 604a99bd464c92d77ef2476ab9779cddb72339c4
> Author: Nicholas Clark <nick@ccl4.org>
> Date: Wed Jan 4 11:36:25 2012 +0100
>
> defined(@array) now also warns for package variables.
>
> M op.c
> M pod/perldelta.pod
> M t/lib/strict/refs
> M t/lib/warnings/op
>
> commit b880f709320776e295c5359276e8eb7a40ce30c0
> Author: Nicholas Clark <nick@ccl4.org>
> Date: Wed Jan 4 11:23:17 2012 +0100
>
> Test that defined warns for package arrays and hashes.
>
> Currently TODO'd for package arrays. The existing tests were only for
> lexicals.
>
> M t/lib/warnings/op
> -----------------------------------------------------------------------
>
> Summary of changes:
> op.c | 5 -----
> pod/perldelta.pod | 5 ++++-
> t/lib/strict/refs | 2 ++
> t/lib/warnings/op | 12 ++++++++++++
> toke.c | 7 ++-----
> 5 files changed, 20 insertions(+), 11 deletions(-)
So far so good, but this hunk:
> diff --git a/toke.c b/toke.c
> index 6766c05..fa4c9c9 100644
> --- a/toke.c
> +++ b/toke.c
> @@ -614,11 +614,8 @@ Perl_feature_is_enabled(pTHX_ const char *const name, STRLEN namelen)
> return FALSE;
> memcpy(&he_name[8], name, namelen);
>
> - return
> - cop_hints_fetch_pvn(
> - PL_curcop, he_name, 8 + namelen, 0,
> - REFCOUNTED_HE_EXISTS
> - );
> + return cBOOL(cop_hints_fetch_pvn(PL_curcop, he_name, 8 + namelen, 0,
> + REFCOUNTED_HE_EXISTS));
> }
>
> /*
>
Is actually from commit c8ca97b0f5c0db7ad9b35fc9c4bea37281bc79ff
commit c8ca97b0f5c0db7ad9b35fc9c4bea37281bc79ff
Author: Nicholas Clark <nick@ccl4.org>
Date: Mon Jan 16 16:21:21 2012 +0100
In Perl_feature_is_enabled() use cBOOL to convert the pointer to a "bool".
On some platforms which don't have a (real) bool type, bool is actually a
char, and hence (sadly) it's correct for the compiler to truncate when
assigning to it, instead of what the programmer thought was going to happen
(testing zero or not). In Perl_feature_is_enabled(), the expression is a
pointer, so if it converts to an integer with the bottom 8 bits zero, then
on these platforms it would truncate to "false". Not what was expected.
And it doesn't make sense why 2 of the 3 got in, as all 3 were commits
new to branch blead, but seen previously on my smoke-me branch under the
same SHA-1s.
Nicholas Clark
-
Re: [perl.git] branch blead, updated. v5.15.6-559-g604a99b
by Nicholas Clark