This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Abigail [Tue, 17 Jan 2017 21:21:29 +0000 (22:21 +0100)]
Avoid triggering a deprecation warnings.
The offending line is put in a block with "no warnings 'deprecated';".
The line can go after 5.26, as it'll be fatal in 5.28.
Abigail [Tue, 17 Jan 2017 21:16:02 +0000 (22:16 +0100)]
Avoid deprecation warning.
Use of an unqualified dump() now gives a deprecation warning. So, change
dump into CORE::dump in the tests.
David Mitchell [Sat, 14 Jan 2017 16:02:46 +0000 (16:02 +0000)]
add S_process_optree() function to op.c
Extract into a new static function, S_process_optree(), some of the common
code that calls rpeep(), finalize_optree() etc in the various
newSUB()-style functions.
There should be no functional changes, except that for formats, pad_tidy()
is now called *after* optimisation. This matches what already happens for
normals subs, and can possibly be regarded as a bug fix - although I can't
think of anything it actually fixes.
There are probably more things that could be consolidated into this
function, but because the details vary amongst the various call sites,
I've left them alone for now.
James E Keenan [Tue, 17 Jan 2017 13:42:28 +0000 (08:42 -0500)]
perldelta for 254707b
Andreas Koenig [Tue, 17 Jan 2017 08:27:49 +0000 (09:27 +0100)]
Updates CPAN.pm to ANDK/CPAN-2.16-TRIAL2.tar.gz
David Mitchell [Tue, 17 Jan 2017 11:55:58 +0000 (11:55 +0000)]
davem's perldelta entries for 5.25.9 so far
Tony Cook [Tue, 17 Jan 2017 04:36:31 +0000 (15:36 +1100)]
(perl #129149) fix the test so skip has a SKIP: to work with
Thanks to bulk88 for pointing this out.
Zefram [Tue, 17 Jan 2017 00:04:00 +0000 (00:04 +0000)]
warn at most once per literal about misplaced _
Fixes [perl #70878].
Tony Cook [Mon, 16 Jan 2017 23:56:33 +0000 (10:56 +1100)]
perldelta for
bf4a926a2937
Tony Cook [Wed, 7 Sep 2016 06:51:39 +0000 (16:51 +1000)]
(perl #129149) avoid a heap buffer overflow with pack "W"...
Tony Cook [Mon, 16 Jan 2017 22:27:15 +0000 (09:27 +1100)]
perldelta for
02c161ef974f
Karl Williamson [Mon, 16 Jan 2017 20:05:14 +0000 (13:05 -0700)]
perldelta: Fix typo
Abigail [Mon, 16 Jan 2017 18:10:04 +0000 (19:10 +0100)]
Mention changed deprecation messages in perldelta.
Abigail [Mon, 16 Jan 2017 10:44:30 +0000 (11:44 +0100)]
There's an objection to fatalizing jumping into a construct.
This reverts commit
84b32f52b10f9912b40ef378cd0b01f4aff80630.
This reverts commit
d30393aaade31b605724846a30a10dd1e96cd181.
We need more debate on this one; either we should undeprecate it,
or settle on an end-of-life version.
Abigail [Sun, 15 Jan 2017 21:23:47 +0000 (22:23 +0100)]
Use of $* and $# will be fatal in 5.30.
Initially, the plan was to just drop the deprecation message of $* and $#,
letting them be the magicless punctuation variables they are now. However,
we decided to make their use fatal, so we can use them in a future version
of Perl.
Abigail [Sun, 15 Jan 2017 12:23:34 +0000 (13:23 +0100)]
Revert "Remove deprecation warnings related to $* and $#."
This reverts commit
e9b5346b919b4f4cc0096af4644cb0d48d64e14c.
We've decided that instead of leaving $* and $# as usuable, magic-free
variables, we instead make it fatal to use them. Therefore, we restore
the warnings their use gives, and in a subsequent commit, we fix the
warning to indicate the version where their use becomes fatal.
Abigail [Sun, 15 Jan 2017 12:23:12 +0000 (13:23 +0100)]
Revert "Fix mentioning of C<$#>."
This reverts commit
b9a643355baa0bd9bc9b4e9cbaf51c8727589bfa.
Abigail [Sat, 14 Jan 2017 21:34:30 +0000 (22:34 +0100)]
Mention $! vs $^E in pod/perlport.pod
Since 5.24, it has been deprecated to check $! after a Winsock function;
one such use $^E instead. However, since we do not have a deprecation
warning for this, we cannot set an EOL version of this deprecation.
As such, it just gets mentioned in perlport, and this will be the
only deprecation without an EOL version.
Abigail [Sat, 14 Jan 2017 21:28:50 +0000 (22:28 +0100)]
Update an old email address of mine
Abigail [Sat, 14 Jan 2017 21:13:54 +0000 (22:13 +0100)]
String bitwise operators will not accept code points > 0xFF in 5.28
Abigail [Sat, 14 Jan 2017 20:44:56 +0000 (21:44 +0100)]
Reading/writing bytes from :utf8 handles will be fatal in 5.30
Abigail [Sat, 14 Jan 2017 17:25:48 +0000 (18:25 +0100)]
Deprecating the modifyable variables in constants by 5.32.
It was already deprecated, but we're now adding a version number.
Abigail [Sat, 14 Jan 2017 03:01:39 +0000 (04:01 +0100)]
Make it fatal to pass malformed UTF-8.
Due to a bug in either Perl, or in some XS-code, it's possible
for a string which is supposed to be in UTF-8 format to not be
properly encoded. If you try to find out its type (digit,
punctuation) perl will now croak.
This behaviour was deprecated in Perl 5.18.
Abigail [Sat, 14 Jan 2017 01:30:49 +0000 (02:30 +0100)]
my() in a false conditional will be fatal in Perl 5.30
Abigail [Fri, 13 Jan 2017 21:36:47 +0000 (22:36 +0100)]
Deprecation of an unqualified dump() to mean CORE::dump().
This will no longer be allowed in 5.30.
Abigail [Fri, 13 Jan 2017 19:29:58 +0000 (20:29 +0100)]
Deprecating the use of C<< \cI<X> >> to specify a printable character.
Starting in 5.14, we deprecated the use of "\cI<X>" when this
results in a printable character. For instance, "\c:" is just
a fancy way of writing "z". Starting in 5.28, this will be a
fatal error.
This also includes certain usage in regular expressions with the
experimental (?[ ]) construct, or when "use re 'strict'" is in
effect (also experimental).
Abigail [Thu, 24 Nov 2016 14:35:43 +0000 (15:35 +0100)]
B::OP::terse will go away in Perl 5.28.
Adjusted the deprecation message, and bumped the version of B::Terse.
Abigail [Thu, 24 Nov 2016 12:57:23 +0000 (13:57 +0100)]
No longer mention some uses of $SIG {__DIE__} are deprecated.
The C<$SIG{__DIE__}> hook is called even inside an C<eval()>. It was
never intended to happen this way, but an implementation glitch made
this possible. This used to be deprecated, as it allowed strange action
at a distance like rewriting a pending exception in C<$@>. Plans to
rectify this have been scrapped, as users found that rewriting a
pending exception is actually a useful feature, and not a bug.
Abigail [Thu, 24 Nov 2016 12:22:10 +0000 (13:22 +0100)]
Remove utils/c2ph and utils/pstruct
These programs are the same, just behave differently depending on
under which name you call it.
This is a very old script, originally dating from the perl3 era.
It has been deprecated in favour of h2xs for a long time.
In Perl 5.26, these utilities will no longer be available.
Abigail [Thu, 24 Nov 2016 11:40:04 +0000 (12:40 +0100)]
Don't recognize the --libpods option in Pod::Html
Since Perl 5.18, the --libpods option has been recognized, but
did not do anything other than issue a deprecation warnings.
As of now, using the --libpods option creates an error.
The version number of Pod::Html has bumped to 1.2202.
Abigail [Thu, 24 Nov 2016 00:11:01 +0000 (01:11 +0100)]
Remove unneeded entry from pod/perldiag.pod
It had an entry 'Use of %s is deprecated', matching the warnings
the deprecation() macro in handy.h could generate.
Most of these warning had already their own entries in perldiag.pod,
and the ones which did not, now do. Furthermore, the format of the
warnings has changed, as we now have a version in which the construct
disappears from Perl in the message.
Abigail [Wed, 23 Nov 2016 23:50:09 +0000 (00:50 +0100)]
Use of inherited AUTOLOAD for non-methods will be fatal in 5.28.
Which will be 21 years after it was deprecated (5.004).
Abigail [Wed, 23 Nov 2016 22:03:13 +0000 (23:03 +0100)]
Remove the deprecate() macro from handy.h.
Since we now require each deprecation message to come with a
version in which the feature will disappear, and we have reworked
the existing uses of this macro, there doesn't seem to be a need
for this one anymore.
Abigail [Wed, 23 Nov 2016 21:52:36 +0000 (22:52 +0100)]
Jumping into constructs will be fatal in 5.28.
Abigail [Wed, 23 Nov 2016 18:38:15 +0000 (19:38 +0100)]
Use of comma-less variable lists is deprecated.
It will be fatal by Perl 5.28.
Abigail [Wed, 23 Nov 2016 18:06:51 +0000 (19:06 +0100)]
Use of Unicode code points exceeding IV_MAX will be fatal in Perl 5.28
Changed the warning to reflect the deadline of this deprecation.
Update tests, perldiag.pod and added a section to perldeprecation.pod.
Abigail [Mon, 21 Nov 2016 21:38:32 +0000 (22:38 +0100)]
Unescaped left braces in regular expressions will be fatal in 5.30.
In 5.26, some uses of unescaped left braces were made fatal; they have
given a deprecation warning since 5.20. Due to an oversight, some cases
were missed, and did not give a deprecation warning. They do now.
This patch changes said deprecation warning to mention the Perl version
in which the use of an unescaped left brace will be fatal (5.30).
The patch also cleans up some unnecessary quotes inside a C<> construct
in the discussion of this warning in perldiag.pod.
Abigail [Fri, 18 Nov 2016 17:33:19 +0000 (18:33 +0100)]
Bare heredocs will be fatal in 5.28.
Heredocs without a terminator after the << have been deprecated
since 5.000. After more than 2 decades, it's time to retire this
construct. They will be fatal in 5.28.
Abigail [Fri, 18 Nov 2016 16:41:44 +0000 (17:41 +0100)]
Use of \N{} will be fatal in 5.28.
Use of \N{} in a double quoted context, with nothing between the
braces, was deprecated in 5.24, and it will be a fatal error in 5.28.
Abigail [Fri, 18 Nov 2016 13:56:56 +0000 (14:56 +0100)]
Reformat overlong comment.
pod/perlhack.pod says to try hard not to exceed 79 columns.
Abigail [Fri, 18 Nov 2016 13:52:18 +0000 (14:52 +0100)]
$/ = \-1 will be fatal in Perl 5.28.
Setting $/ to a reference of a non-positive integer has been deprecated
since 5.20, in which it was special cased to act like you had set to
$/ to undef.
In Perl 5.28, setting $/ to a reference to a non-positive integer will
be a fatal error.
Abigail [Thu, 17 Nov 2016 18:34:37 +0000 (19:34 +0100)]
Opening a file and dir using the same symbol will be fatal in 5.28.
Perl 5.10 deprecated using the same symbol to open both a filehandle
and a dirhandle, as this can lead to confusing code.
In Pelr 5.28, this will become a fatal error. This patch changes the
warning to reflect this.
Abigail [Wed, 16 Nov 2016 23:38:38 +0000 (00:38 +0100)]
Fix mentioning of C<$#>.
A copy and past left a C<$*> instead of a C<$#>.
Pointed out by douglas steinwand.
Abigail [Wed, 16 Nov 2016 18:07:32 +0000 (19:07 +0100)]
Setting ${^ENCODE} will be fatal by 5.28.
Hence, we adapted the warning, to mention the version in which it
will become a fatal error.
Abigail [Tue, 15 Nov 2016 23:20:31 +0000 (00:20 +0100)]
Be consistent when addressing Perl.
In perldeprecation.pod, when referring to a particular perl version,
use "Perl 5.XX" (or "Perl 5.00X" for pre-5.6 versions) consistently.
Abigail [Tue, 15 Nov 2016 22:51:53 +0000 (23:51 +0100)]
Remove deprecation warnings related to $* and $#.
The magic variables $* and $# were deprecated in 5.000. Their magical
meaning was removed in Perl 5.10. Since then, a warning was issued
if the variables were used.
This warnings has been removed.
Abigail [Tue, 15 Nov 2016 18:35:28 +0000 (19:35 +0100)]
Time limit the deprecation of :unique and :locked.
The :unique and :locked attributes have had no effect since 5.8.8
and 5.005 respectively. They were deprecated in 5.12. They are now
scheduled to be deleted in 5.28.
There are two places the deprecation warning can be issued:
in lib/attributes.pm, and in toke.c. The warnings were phrased
differently, but since we're changing the warning anyway (as we
added the version of Perl in which the attributes will disappear),
we've used the same phrasing for this warning, regardless of where
it is generated:
Attribute "locked" is deprecated, and will disappear in Perl 5.28
Attribute "unique" is deprecated, and will disappear in Perl 5.28
Abigail [Mon, 14 Nov 2016 18:13:29 +0000 (19:13 +0100)]
Drop .0 from version numbers.
Since most perl versions we will refer to in this document will be
major releases, we'll drop the trailing ".0" whenever we mention
a version.
Abigail [Mon, 14 Nov 2016 18:08:12 +0000 (19:08 +0100)]
Actively deprecate File::Glob::glob().
This function has been deprecated since 5.8. However, no deprecation
message was issued; only perl5.008delta.pod and a comment in the file
mention its deprecation.
This patch issues a deprecation message, and warns the user it will
be gone in perl 5.30. Since all this method does is calling
File::Glob::bsd_glob anyway, code calling this is easily fixed.
Abigail [Mon, 14 Nov 2016 16:26:42 +0000 (17:26 +0100)]
Move discussion of using tie and friends on * less scalars which hold globs
This was deprecated in 5.14, and fixed in 5.16. Hence, it's moved out
of pod/perldiag.pod, and added to pod/perldeprecation.pod.
Abigail [Mon, 14 Nov 2016 15:16:49 +0000 (16:16 +0100)]
Removed entry "Setting ${^ENCODING} is deprecated"
pod/perldiag.pod mentions twice that the use of ${^ENCODING} is deprecated.
This is overkill, and we've removed the entry which uses wording which is
no longer used.
Abigail [Mon, 14 Nov 2016 15:12:12 +0000 (16:12 +0100)]
Deprecated POSIX functions were removed in 5.24.0
Therefore, we no longer need the entry in pod/perldiag.pod. We
do however need an entry in pod/perldeprecation.pod.
Abigail [Mon, 14 Nov 2016 13:35:00 +0000 (14:35 +0100)]
Created pod/perldeprecation.pod
This pod is intended to document all deprecations in Perl.
It will document when something became deprecated, when it is
scheduled to be actually removed, and it will offer alternatives.
Initially, we documented the undeprecation of *glob{FILEHANDLE},
and removed its entry from pod/perldiag.pod where it was left
after it being no longer deprecated.
Karl Williamson [Mon, 16 Jan 2017 18:00:12 +0000 (11:00 -0700)]
perluniintro: Remove obsolete text
This refers to future plans about 5.24; 5.24 no longer is in the future.
Tony Cook [Mon, 5 Dec 2016 00:48:14 +0000 (11:48 +1100)]
(perl #130262) split scalar context stack overflow fix
pp_split didn't ensure there was space for its return value
in scalar context.
James E Keenan [Sun, 15 Jan 2017 00:07:21 +0000 (19:07 -0500)]
Correct spelling error.
Craig A. Berry [Sat, 14 Jan 2017 21:44:15 +0000 (15:44 -0600)]
Use File::Spec->catfile() in Test2's Files.t test.
Explicitly using forward slashes to concatenate filenames is not
portable and we've already loaded File::Spec anyway. Also, don't
try to remove the directory we're cleaning up unless we were
successful in opening it.
Craig A. Berry [Sat, 14 Jan 2017 20:44:15 +0000 (14:44 -0600)]
Don't escape tilde when converting to VMS filespecs.
There is only one use case for requiring a tilde to be escaped,
and that is when it is the first character in a file or directory
component and is *not* an indication of a special shell expansion
such as the user's home directory. This scenario simply can't
come up when translating a Unix-format path to VMS format, so
there is nothing to be gained by escaping.
Escaping things we don't need to runs afoul of other goofy things
people do with filenames. Test2 encodes data in tilde-delimited
temporary filenames and uses a naive join and split to manipulate
the components. Adding a caret escape to each component is a
data corruption in this scheme, and this patch fixes test failures
in Test2 without any changes to that module.
Steve Hay [Sat, 14 Jan 2017 21:45:13 +0000 (21:45 +0000)]
5.22.3 and 5.24.1 are done
5.22.4 and 5.24.2 are imminent
Steve Hay [Sat, 14 Jan 2017 21:30:59 +0000 (21:30 +0000)]
Import perldeltas from 5.22.3 and 5.24.1
Steve Hay [Sat, 14 Jan 2017 21:26:35 +0000 (21:26 +0000)]
Import Module::CoreList data for 5.22.3 and 5.24.1
Steve Hay [Sat, 14 Jan 2017 20:44:45 +0000 (20:44 +0000)]
Add epigraphs for 5.22.3 and 5.24.1
Steve Hay [Sat, 14 Jan 2017 18:08:39 +0000 (18:08 +0000)]
5.22.3 and 5.24.1 today
Father Chrysostomos [Fri, 13 Jan 2017 06:17:04 +0000 (22:17 -0800)]
[perl #130546] Restore delete-scalar-slice warning
Commit v5.19.3-506-g429a25554a reduced false positives with the annoy-
ing ‘Scalar value such-and-such better written as such-and-such’ warn-
ing by flagging the op in the lexer (instead of warning immediately),
and then checking the op tree later, in order to avoid false positives
with perfectly valid constructs, such as qw"...".
The new code that checked the op tree looked for hslice and aslice
ops, but in the particular case of delete @a{...} and delete @a[...],
the slice op gets nulled and the delete op takes care of the slicing
operation (if you can call it that) itself. The result was that the
warning disappeared altogether for delete.
This commit makes op.c check also for nulled hslice and aslice ops,
and applies the same heuristics to them as to unnulled slicing ops.
Karl Williamson [Tue, 10 Jan 2017 17:31:29 +0000 (10:31 -0700)]
re.pm: pod formatting nits, and clarifications
Karl Williamson [Fri, 6 Jan 2017 05:03:35 +0000 (22:03 -0700)]
Warn on unescaped /[]}]/ under re strict
This commit generates a warning when the experimental 're strict'
feature is in effect for unescaped '}' and ']' characters (in a regular
expression pattern) that are interpreted literally.
This brings the behavior of these more in line with ')' which croaks
when it is taken literally.
The problem with the existing behavior is that these characters may be
metacharacters or they may be literals, depending on action at a
distance. Not so with ')', which is always a metacharacter unless
escaped.
Ideally, all three of these characters should behave similarly, but it
really is too late for that, except we can warn if the user has
requested extra checking of their patterns with this experimental
're strict' feature.
Karl Williamson [Fri, 6 Jan 2017 04:51:12 +0000 (21:51 -0700)]
t/re/reg_mesg.t: Add new ability
This now allows one to say that a warning message is to be expected if
and only if 'use re "strict"' is on.
Karl Williamson [Tue, 10 Jan 2017 18:09:33 +0000 (11:09 -0700)]
Various .t's: Escape literal '}' and ']' in patterns
It is clearer to show that these characters which are sometimes meta and
sometimes literal are meant to be taken literally here.
Karl Williamson [Fri, 6 Jan 2017 02:28:38 +0000 (19:28 -0700)]
regcomp.c: Clarify comment.
Karl Williamson [Thu, 12 Jan 2017 18:07:47 +0000 (11:07 -0700)]
Add /xx regex pattern modifier
This was first proposed in the thread starting at
http://www.nntp.perl.org/group/perl.perl5.porters/2014/09/msg219394.html
Karl Williamson [Fri, 13 Jan 2017 18:17:25 +0000 (11:17 -0700)]
perlre: Clarifications, typos
Karl Williamson [Wed, 11 Jan 2017 02:10:58 +0000 (19:10 -0700)]
perlretut: Add some white space for legibility
Karl Williamson [Thu, 12 Jan 2017 05:18:53 +0000 (22:18 -0700)]
regcomp.c: Remove obsolete data structure element
This was used for the removed feature of having the source in a
different encoding.
Karl Williamson [Fri, 13 Jan 2017 04:05:35 +0000 (21:05 -0700)]
pp_sys.c: White space only
Vertically align some components of an 'if' for readability.
James E Keenan [Thu, 12 Jan 2017 22:15:30 +0000 (17:15 -0500)]
Write tests for RT #77934.
Assistance with test provided by Jerry Hedden.
Karl Williamson [Wed, 11 Jan 2017 21:21:16 +0000 (14:21 -0700)]
Rmv unused regex implementation structure element
Karl Williamson [Mon, 9 Jan 2017 22:40:54 +0000 (15:40 -0700)]
PATCH: [perl #130530]: HP-UX assertion failure
This was introduced in
a1a5ec35e6a3df0994b103aadb28a8c1a3a278da, and was
due to a thinko on my part. Zefram figured it out.
A macro evaluating to a string constant returns an instance of that
constant. Compilers are free to collapse all instances into a single
one (which saves space), or to have multiple copies. The code was
assuming the former, and HP-UX cc doesn't.
The passed size also was one byte larger than it should have been.
Hugo van der Sanden [Mon, 9 Jan 2017 16:46:11 +0000 (16:46 +0000)]
[perl #130522] test cases for len(STCLASS) > len(target)
Hugo van der Sanden [Sun, 8 Jan 2017 14:59:36 +0000 (14:59 +0000)]
[perl #130522] don't try to find_by_class outside the string
If the calculated latest start position to try is before our current
start position, stop immediately: else we can read out of bounds,
and end up doing unnecessary work.
Hugo van der Sanden [Sun, 8 Jan 2017 14:54:57 +0000 (14:54 +0000)]
[perl #130522] do not allow endpos to exceed strend
Check substrings can come from lookaheads, so their length can exceed
minlen. Use a clamped variant of HOP3c to avoid a bad endpos in this case.
Tomasz Konojacki [Tue, 10 Jan 2017 02:47:51 +0000 (03:47 +0100)]
(perl #130534) fix test failures under DragonFly BSD
Karl Williamson [Tue, 10 Jan 2017 19:34:52 +0000 (12:34 -0700)]
Add Tomasz Konojacki to AUTHORS
Karl Williamson [Tue, 10 Jan 2017 18:38:34 +0000 (11:38 -0700)]
t/loc_tools.pl: Quit immediately if incompat locale
The design of this was to not continue when presented with a locale that
we have discovered is incompatible with Perl. Instead it was soldiering
on. Those incompatibilities could cause segfaults, etc if the libc
isn't fully protected against unexpected input.
Karl Williamson [Tue, 10 Jan 2017 18:35:05 +0000 (11:35 -0700)]
t/loc_tools.pl: Allow for multiple warnings
This code searched the first warning for particular patterns. It really
should search all warnings for complete correctness.
Karl Williamson [Tue, 10 Jan 2017 18:33:32 +0000 (11:33 -0700)]
t/loc_tools.pl: Emphasize input conditions in comment
Karl Williamson [Tue, 10 Jan 2017 18:32:53 +0000 (11:32 -0700)]
locale.c: Fix typo in comment
Karl Williamson [Tue, 10 Jan 2017 18:31:01 +0000 (11:31 -0700)]
locale.c: -DL shouldn't affect other things
Prior to this commit, -DL would cause a message to be suppressed
elsewhere. Code could be relying on that message being output in the
expected place.
Tony Cook [Mon, 9 Jan 2017 00:09:50 +0000 (11:09 +1100)]
perldelta for
95309d6ba0f3
Tony Cook [Thu, 8 Dec 2016 03:14:11 +0000 (14:14 +1100)]
add build options to disable the PERL_HASH* and PERL_PERTURB_KEYS env vars
These variables either control or reveal information used in perl's
hash implementation that a careful user may not want controlled or
exposed.
Karl Williamson [Sun, 8 Jan 2017 17:41:56 +0000 (10:41 -0700)]
perlpodspec: Note Pod::Simple instead of Pod::Parser
Pod::Parser is on its way out from core. This changes the text to
correspond.
Hugo van der Sanden [Sat, 7 Jan 2017 01:27:50 +0000 (01:27 +0000)]
[perl #130495] add fresh_perl() option for prog with embedded utf8
Support { wide_chars => 1 } in the args hash to fresh_perl*() functions,
and use it for the recently added test in re/pat.t
Aaron Crane [Sat, 7 Jan 2017 15:32:46 +0000 (15:32 +0000)]
Improve perlintern.pod docs for PL_dowarn
Aaron Crane [Sat, 7 Jan 2017 13:57:05 +0000 (13:57 +0000)]
Fix save-stack type error
Peter Avalos [Sat, 7 Jan 2017 14:32:08 +0000 (14:32 +0000)]
add setproctitle() support for DragonFly BSD
RT #130068
(applied untested, as I don't have access to a dragonfly box - DAPM)
David Mitchell [Sat, 7 Jan 2017 14:12:05 +0000 (14:12 +0000)]
fix some comment typos about PL_isa_DOES
... and expand one of the comments a bit.
Aaron Crane [Fri, 6 Jan 2017 17:03:21 +0000 (17:03 +0000)]
cflags.SH: omit a needless process in generated file
Using the shell "case" statement rather than grep(1) will save a process on
every core C file compiled.
David Mitchell [Sat, 7 Jan 2017 10:09:28 +0000 (10:09 +0000)]
t/perf/optree.t: remove obsolete comment
with commit v5.25.8-172-gb243b19, I removed some special-casing of the A
in (A&&B) being in boolean context, but forgot to remove a comment
describing this special-casing.
James E Keenan [Fri, 6 Jan 2017 22:56:50 +0000 (17:56 -0500)]
Eliminate two unused variables detected by clang.
"warning: unused variable 'i' [-Wunused-variable]"
David Mitchell [Fri, 6 Jan 2017 16:28:50 +0000 (16:28 +0000)]
[MERGE] redo boolean context
Overhaul the stuff that flags an op as being in boolean context (currently
just padhv and rv2hv). Make the mechanism in rpeep() general, so that
other ops can be easily added in future, and add a generic testing
framework for such ops in t/perf/optree.t.
This alters the amount on situations recognised as being in boolean
context (mainly increasing them).
David Mitchell [Fri, 6 Jan 2017 11:35:11 +0000 (11:35 +0000)]
In A && B, stop special-casing boolean-ness of A
Some ops, (currently PADHV and RV2HV) can be flagged as being in boolean
context, and if so, may return a simple truth value which may be more
efficient to calculate than a full scalar value. (This was originally
motivated by code like if (%h) {...}, where the scalar context %h returned a
bucket ratio string, which involved counting how many HvARRAY buckets were
non-empty, which was slow in large hashes. It's been made less important
since %h in scalar context now just returns a key count, which is quick to
calculate.)
There is an issue with the A argument of A||B, A//B and A&&B, in that,
although A checked by the logop in boolean context, depending on its
truth value the original A may be passed through to the next op. So in
something like $x = (%h || -1), it's not sufficient for %h to return a
truth value; it must return a full scalar value which may get assigned to
$x.
So in general, we only mark the A op as being in boolean context if the
logop is in void context, or if the returned A would only be consumed in
boolean context; so !(A||B) would be ok for example.
However, && is a special case of this, since it will return the original A
only if A was false. Before this commit, && was special-cased to mark A as
being in boolean context regardless of the context of (A&&B). The downside
of this is that the A op can't just return &PL_sv_no as a false value;
it has to return something that is usable in scalar context too. For
example with %h, it returns sv_2mortal(newSViv(0))), which stringifies to
"0" while &PL_sv_no stringifies to "".
This commit removes that special case and makes && behave like || and //
again.
The upside is that some ops in boolean context will be able to more
cheaply return a false value (e.g. just &PL_sv_no verses
sv_2mortal(newSViv(0))).
The main downside is that && in unknown context (typically an
'if (%h} {...}' as the last statement in a sub) will have to check at
runtime whether the caller context is slower. It will also have to return
a scalar value for something like $y = (%h && $x), but that's a relatively
uncommon occurrence, and now that %h in scalar context doesn't have to
count used buckets, the extra cost in these rare cases is minor.