This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
6 years agoyyparse: replace some gotos with a while(1) loop
David Mitchell [Sat, 3 Dec 2016 15:11:11 +0000 (15:11 +0000)]
yyparse: replace some gotos with a while(1) loop

Just as efficient, and more readable.
Welcome to 1970's structured programming!

6 years agooptimising yyparse: avoid a < 0 check
David Mitchell [Sat, 3 Dec 2016 14:08:56 +0000 (14:08 +0000)]
optimising yyparse: avoid a < 0 check

casting to unsigned allows (0 <= yyn <= YYLAST) to be done in a single
conditional.

6 years agooptimising yyparse: replace stack_size with a ptr
David Mitchell [Sat, 3 Dec 2016 14:01:19 +0000 (14:01 +0000)]
optimising yyparse: replace stack_size with a ptr

Makes testing whether the parser stack needs extending cheaper

6 years agomake sure that new heredoc parsing doesn't COW during prefix strip
Yves Orton [Sat, 26 Nov 2016 19:12:41 +0000 (20:12 +0100)]
make sure that new heredoc parsing doesn't COW during prefix strip

6 years agofix sort order to be by key alone, not key and value
Yves Orton [Fri, 18 Nov 2016 10:18:00 +0000 (11:18 +0100)]
fix sort order to be by key alone, not key and value

Sorting with the value part of the statement means that
"perl5=foo" sorts before "perl=foo", where sorting by the
keys alone would put "perl" before "perl5".

This makes the order in the data correspond to what you
would see with sort keys %Config.

6 years agoUpdate bignum to CPAN version 0.44
Chris 'BinGOs' Williams [Sat, 3 Dec 2016 07:34:55 +0000 (07:34 +0000)]
Update bignum to CPAN version 0.44

  [DELTA]

2016-11-15 pjacklam 0.44

  * Update bundled Module::Install from version 1.16 to version 1.17.

  * Replace function calls with method calls.

  * Include patch for CPAN RT #116506.

6 years agoUpdate Math-BigRat to CPAN version 0.260805
Chris 'BinGOs' Williams [Sat, 3 Dec 2016 07:25:54 +0000 (07:25 +0000)]
Update Math-BigRat to CPAN version 0.260805

  [DELTA]

2016-11-15 v0.260805 pjacklam

 * Standardize on using $LIB for the variable holding the class of the backend
   library.

 * Improve bmul() by doing _gcd() twice on smaller numbers rather than once on
   larger numbers.

6 years agoUpdate Math-BigInt-FastCalc to CPAN version 0.5002
Chris 'BinGOs' Williams [Sat, 3 Dec 2016 07:23:23 +0000 (07:23 +0000)]
Update Math-BigInt-FastCalc to CPAN version 0.5002

  [DELTA]

2016-11-23 v0.5002 pjacklam
  * Sync test files with Math-BigInt-1.999801. Add t/biglog.t and t/bigroot.t
    since these are included in the test suite for the other backend libraries
    (GMP and Pari).

2016-11-17 v0.5001 pjacklam
  * Avoid 'use parent' to retain compatibility with old Perls.

  * Fix incorrect version numbers in the CHANGES file.

  * Trim whitespace.

2016-11-15 v0.5000 pjacklam
  * Sync test files with Math-BigInt-1.999800.

  * Math::BigInt::FastCalc is now a subclass of Math::BigInt::Calc, so remove
    aliases like *Math::BigInt::FastCalc::_xxx = \&Math::BigInt::Calc::_xxx.

  * Use OO-calls rather than function calls.

  * Fix documentation error in Math::BigInt::FastCalc

6 years agoUpdate Math-BigInt to CPAN version 1.999802
Chris 'BinGOs' Williams [Sat, 3 Dec 2016 07:14:13 +0000 (07:14 +0000)]
Update Math-BigInt to CPAN version 1.999802

  [DELTA]

2016-11-15 v1.999800 pjacklam

 * Upgrade bundled Module::Install from version 1.16 to version 1.17.

 * Add Math::BigInt::Lib (lib/Math/BigInt/Lib.pm), a parent class for
   Math::BigInt backend libraries.

 * Use objects in Math::BigInt::Calc, not just array refs. Also use OO-style,
   i.e., use $class->_add($x, $y) rather than _add($class, $x, $y).

 * Not all library methods modify the invocand, so call library methods as,
   e.g, $x = $LIB->method($x, $y) rather than just $LIB->method($x, $y).

 * Math::BigInt::Calc is now a subclass of Math::BigInt::Lib.

 * Add Math::BigInt::Lib::Minimal (t/Math/BigInt/Lib/Minimal.pm) for testing
   inheritance from Math::BigInt::Lib.

 * Minor simplification in Math::BigInt::Calc->_str().

 * Speed up Math::BigInt::Calc->_root().

 * Remove test files that were included in the previous release by accident.

 * Add more tests and use more verbose output in some tests.

 * Fix typo in lib/Math/BigFloat.pm

 * Fix documentation error in lib/Math/Calc.pm

 * Use Config::Tiny and an .ini file to handle the library specific
   configuration for the author-lib*.t test files.

2016-11-23 v1.999801 pjacklam

 * Fix, hopefully once and for all, the longstanding problem of handling undef
   as an operand to mathematical methods. The only method that accepts undef as
   an operand is blog(), where the second operand might be undef, as in
   $x->blog() or $x->blog($b), where $b is undef. The undef signifies that
   Euler's number should be used as the base. With this fix, we should be able
   to get Math::BigInt::Lite working again.

 * Add least common multiple method _lcm() to Math::BigInt::Lib, and add
   corresponding test file t/author-lib-arithmetic-binary-_lcm.t and test data
   file t/author-lib-arithmetic-binary-_lcm.dat.

 * Remove internal function __lcm() which has become redundant now that _lcm()
   is in the library.

 * Make it possible to use bgcd() and blcm() as class methods, since other
   methods can be used as class methods. This applies to both Math::BigInt and
   Math::BigFloat.

 * Fix blcm() with negative input. The LCM should always be non-negative. This
   applies to both Math::BigInt and Math::BigFloat.

 * Add tests for bgcd() and blcm() in t/bigintpm.t and t/bigfltpm.t.

 * Fix tests for blcm() assuming that LCM(0,0) should be a NaN. LCM(0,0) is 0
   by convention.

 * Prefer Class->config('option') over Class->config()->{option}. However, this
   does not seem to be working for all options. It seems that this won't work
   properly until we move the global variables into the OO interface.

 * Explicitly specify the library in all test files that are shared between
   Math-BigInt and the library distributions (FaatCalc, GMP, Pari, ...) with,
   e.g., "use Math::BigInt only => 'Calc';". This way, it will fail immediately
   if the specified library can't be loaded rather than using the fallback
   library.

2016-11-28 v1.999802 pjacklam

 * When bzero(), bone(), binf(), and bnan() are used as constructors, don't
   check whether the class allows the object to be modified. This applies to
   both Math::BigInt and Math::BigFloat.

 * Improve bgcd() and blcm(). This applies to both Math::BigInt and
   Math::BigFloat.

6 years agoUpdate Test-Simple to CPAN version 1.302067
Chris 'BinGOs' Williams [Sat, 3 Dec 2016 06:47:12 +0000 (06:47 +0000)]
Update Test-Simple to CPAN version 1.302067

  [DELTA]

1.302067  2016-11-23 07:37:56-08:00 America/Los_Angeles

    - Fix context test for recent blead.

1.302066  2016-11-08 07:58:39-08:00 America/Los_Angeles (TRIAL RELEASE)

    - Handle cases where SysV IPC can be available but not enabled
    - Import 'context' into Test2::IPC, it is used by 'cull'
    - Propogate warnings settings to use_ok (#736)

1.302065  2016-10-30 11:54:37-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Set the TEST_ACTIVE env var to true
    - Set the TEST2_ACTIVE env var to true
    - Fix the oldest bug still in the bug list (#6)
      This fixes cmp_ok output is some confusing cases
    - Update travis config
    - Add missing author deps
    - Fix handling of negative pid's on windows
    - Add can() to Test::Tester::Delegate (despite deprecation)
    - Fix some minor test issues

1.302064  2016-10-24 21:03:24-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Repo management improvements
    - Better handling of info vs diag in ->send_event
    - Fix test that used 'parent'
    - Better handling of non-bumping failures (#728)

1.302063  2016-10-23 21:31:20-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Fix double release when 'throw' is used in context_do()

6 years agoReconcile Time-HiRes with CPAN release
Chris 'BinGOs' Williams [Sat, 3 Dec 2016 06:45:17 +0000 (06:45 +0000)]
Reconcile Time-HiRes with CPAN release

6 years agoUpdate Time-Local to CPAN version 1.25
Chris 'BinGOs' Williams [Sat, 3 Dec 2016 06:42:34 +0000 (06:42 +0000)]
Update Time-Local to CPAN version 1.25

  [DELTA]

1.25     2016-11-17

- Reduce memory usage by only loading Config if needed and not importing from
  Carp. Based on PR #2 from J. Nick Coston.

6 years agoUpdate Unicode-Collate to CPAN version 1.19
Chris 'BinGOs' Williams [Sat, 3 Dec 2016 06:38:51 +0000 (06:38 +0000)]
Update Unicode-Collate to CPAN version 1.19

  [DELTA]

1.19  Sat Dec  3 09:32:31 2016
    - U::C::Locale newly supports locales: he, vo.
    - locales updated to CLDR 24: az, haw.
    - locale updated to CLDR 26: et.

6 years agoMove miscategorized files.
Andy Lester [Sat, 3 Dec 2016 02:51:14 +0000 (21:51 -0500)]
Move miscategorized files.

The pod/.gitignore file has sections of files that should be ignored.
Three of the files are in the wrong section, in the
architecture-specific section instead of the generated-files section.
This changes no functionality, but may help future maintainers from
confusion.

For: RT #130194

6 years agoSilent const correctnes warnings in utf8_hop functions
Petr Písař [Mon, 28 Nov 2016 12:06:24 +0000 (13:06 +0100)]
Silent const correctnes warnings in utf8_hop functions

GCC -Wcast-qual option reports a const violation in utf8_hop
functions. They take a pointer to constant data but returns pointer to
non-constant data.

It's impossible to fix this without changing their prototype.
Therefore this patch asks a compiler to ignore the violations.

Signed-off-by: Petr Písař <ppisar@redhat.com>
6 years agoFix const correctness in utf8.h
Petr Písař [Thu, 24 Nov 2016 16:12:41 +0000 (17:12 +0100)]
Fix const correctness in utf8.h

The original code was generated and then hand-tunes. Therefore
I edited the code in place instead of fixing the regen/regcharclass.pl
generator.

Signed-off-by: Petr Písař <ppisar@redhat.com>
6 years agoFix const correctness in hv_func.h
Petr Písař [Thu, 24 Nov 2016 15:34:09 +0000 (16:34 +0100)]
Fix const correctness in hv_func.h

Building an XS code with -Wcast-qual yielded warnings about discarding
const qualifiers from pointer targets like:

$ printf '#include "EXTERN.h"\n#include "perl.h"\n' | gcc -Wcast-qual -I/usr/lib64/perl5/CORE -c -x c -
In file included from /usr/lib64/perl5/CORE/hv.h:629:0,
                 from /usr/lib64/perl5/CORE/perl.h:3740,
                 from <stdin>:2:
/usr/lib64/perl5/CORE/hv_func.h: In function ‘S_perl_hash_siphash_2_4’:
/usr/lib64/perl5/CORE/hv_func.h:213:17: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
   U64TYPE k0 = ((U64TYPE*)seed)[0];
                 ^

Signed-off-by: Petr Písař <ppisar@redhat.com>
6 years agosplit was leaving PL_sv_undef in unused ary slots
David Mitchell [Wed, 30 Nov 2016 08:59:01 +0000 (08:59 +0000)]
split was leaving PL_sv_undef in unused ary slots

This:

    @a = split(/-/,"-");
    $a[1] = undef;
    $a[0] = 0;

was giving

    Modification of a read-only value attempted at foo line 3.

This is because:

1) unused slots in AvARRAY between AvFILL and AvMAX should always be
null; av_clear(), av_extend() etc do this; while av_store(), if storing
to a slot N somewhere between AvFILL and AvMAX, doesn't bother to clear
between (AvFILL+1)..(N-1) on the assumption that everyone else plays
nicely.

2) pp_split() when splitting directly to an array, sometimes over-splits
and has to null out the excess elements;

3) Since perl 5.19.4, unused AV slots are now marked with NULL rather than
&PL_sv_undef;

4) pp_split was still using &PL_sv_undef;

The fault was with (4), and is easily fixed.

6 years agoRemove support for Splint static source code analyzer
Andy Lester [Wed, 30 Nov 2016 05:39:08 +0000 (16:39 +1100)]
Remove support for Splint static source code analyzer

Splint has not been updated since 2007 and doesn’t even build for me.
As far as I know, I'm the only person who's ever worked with Splint on
Perl 5.

Here's what changes:

* Makefile target "splint"
* Macros in XSUB.h and perl.h
* Support in regen/embed.pl

6 years agolib/locale.t: Improve test when NUL isn't a control
Karl Williamson [Tue, 29 Nov 2016 18:28:52 +0000 (11:28 -0700)]
lib/locale.t: Improve test when NUL isn't a control

Commit 535a3fb3ec9051c531a7797f1de40cbfc39e3f7f changed lib/locale.t to
not fail on locales that don't have NUL be a control.  It did this by
skipping the failing test.  However, I realized later that there is a
way to handle the situation without skipping a test, and that is to add
NUL to the list of controls if it isn't already there.

6 years agoA few small tweaks in time64.c
Andy Lester [Tue, 29 Nov 2016 00:33:23 +0000 (11:33 +1100)]
A few small tweaks in time64.c

* The struct TM * pointers to S_check_tm and S_timegm64 functions is
not modified, so make it be a const and let the compiler know it won't
get modified.

* Localize variables to their innermost scopes

* Consting various local variables

6 years agoChange name of PL_ variable
Karl Williamson [Mon, 28 Nov 2016 22:22:08 +0000 (15:22 -0700)]
Change name of PL_ variable

This variable really means the character that replaces any embedded NULs
when doing collation.  Change the name accordingly.  (Embedded NULs must
be replaced because the libc function strxfrm is used, and it operates
on C strings which have no embedded NULs.)

6 years agoPATCH: [perl #129953] lib/locale.t failures on FREEBSD
Karl Williamson [Mon, 28 Nov 2016 16:09:23 +0000 (09:09 -0700)]
PATCH: [perl #129953] lib/locale.t failures on FREEBSD

I thought this bug was in FREEBSD, but when I went to gather the info
needed to report it to the vendor, it turned out to be a mistake I had
made.

The problem is basically doubly encoding into UTF-8.  In order to save
CPU time, in a UTF-8 locale, I had stored a string as UTF-8 encoded.
This string is to be inserted into a larger string.  What I neglected to
consider in this situation is that not all strings in such locales need
be in UTF-8.  The UTF-8 encoded insert could get added to a non-UTF-8
string, and the result later was switched to UTF-8, so the inserted
string's bytes were individually converted to UTF-8, effectively a
second time.  This is a problem only if the inserted string is different
when encoded in UTF-8 than not, and for this particular usage, on most
platforms it was UTF-8 invariant, so did not show up, except on those
platforms where it was variant.

The solution is to store the replacement as a code point, and encode it
as UTF-8 only if necessary, once.  This actually simplifies the code.

6 years agolocale.c: Add some comments
Karl Williamson [Sun, 27 Nov 2016 17:25:49 +0000 (10:25 -0700)]
locale.c: Add some comments

6 years agolib/locale.t: Don't assume NUL is a control
Karl Williamson [Mon, 28 Nov 2016 21:16:18 +0000 (14:16 -0700)]
lib/locale.t: Don't assume NUL is a control

A test that assumed NUL would be considered a control fails in locales
where it isn't considered a control.

This was found on FREEBSD, where the locale "hi_IN.ISCII-DEV" is
defective (based on the Wikipedia article on ISCII
https://en.wikipedia.org/wiki/Indian_Script_Code_for_Information_Interchange).
Only the code points 0x09-0x0D are considered controls in this
implementation, whereas the article says ISCII is a superset of ASCII,
so should have 33 controls, not just 5.  (Unrelated to this ticket, but
another apparent defect I saw is that this implementation defines 0x91,
but the article says that code point is unassigned.)

6 years agolib/locale.t: Improve skipping of incompatible locales
Karl Williamson [Sat, 29 Oct 2016 18:24:21 +0000 (12:24 -0600)]
lib/locale.t: Improve skipping of incompatible locales

Perl works properly with only a subset of the possible locales out
there.  This improves the detection of those and the skipping.

6 years agoJ. Nick Koston is now a perl AUTHOR
Tony Cook [Mon, 28 Nov 2016 23:26:55 +0000 (10:26 +1100)]
J. Nick Koston is now a perl AUTHOR

6 years agobump $Data::Dumper::VERSION and update Changes entries
Tony Cook [Mon, 28 Nov 2016 23:24:15 +0000 (10:24 +1100)]
bump $Data::Dumper::VERSION and update Changes entries

6 years agodist/Data-Dumper/Dumper.pm: Reduce memory usage by removing overload and not importin...
J. Nick Koston [Mon, 14 Nov 2016 09:57:14 +0000 (03:57 -0600)]
dist/Data-Dumper/Dumper.pm: Reduce memory usage by removing overload and not importing Carp

6 years agocrash on explicit return from s///e
David Mitchell [Mon, 28 Nov 2016 08:03:49 +0000 (08:03 +0000)]
crash on explicit return from s///e

RT #130188

In

    sub f {
        my $x = 'a';
        $x =~ s/./return;/e;
    }

the 'return' triggers popping any contexts above the subroutine context:
in this case, a CXt_SUBST context. In this case, Perl_dounwind() calls
cx_popblock() for the bottom-most popped context, to restore any saved
vars. However, CXt_SUBST is the one context type which *doesn't* use
'struct block' as part of its context struct union, so you can't
cx_popblock() a CXt_SUBST context.

This commit makes it skip the cx_popblock() in this case.

Bug was introduced by me with v5.23.7-235-gfc6e609.

6 years agoperlfunc/open: clarify role of mode for undef filename
Aristotle Pagaltzis [Fri, 25 Nov 2016 01:04:52 +0000 (02:04 +0100)]
perlfunc/open: clarify role of mode for undef filename

6 years agoutf8.c: Fix EBCDIC detection of above-31 bit code points
Karl Williamson [Thu, 24 Nov 2016 17:54:23 +0000 (10:54 -0700)]
utf8.c: Fix EBCDIC detection of above-31 bit code points

This was failing on EBCDIC machines, and I couldn't figure out why.  I
didn't see any flaws in the logic.  It required special debugging code
to answer.  It turns out it was a bad declaration, and not logic at all.

The declaration should have been

    const U8 prefix[] = ...

instead it was

    const U8 * const prefix = ...

sizeof() the latter is 4, as it is looking at pointer size.  What was
intended was the size of the array this was initialized to, which was
longer.  What this led to was later in the routine, a comparison was
stopping too early.

6 years agoAPItest/t/utf8.t: White space only
Karl Williamson [Wed, 23 Nov 2016 03:30:56 +0000 (20:30 -0700)]
APItest/t/utf8.t: White space only

This indents the new block formed by the previous commit.  However,
since the indentation is getting too much, it also changes the indents
for all the nested for loops to 2 spaces to allow room on the line.

6 years agoSplit diagnostics for two UTF-8 malformations
Karl Williamson [Wed, 23 Nov 2016 00:47:35 +0000 (17:47 -0700)]
Split diagnostics for two UTF-8 malformations

Some UTF-8 sequences may have multiple malformations.  Commit
2b5e7bc2e60b4c4b5d87aa66e066363d9dce7930 tried to make sure that all
possible ones are raised, instead of abandoning searching after one is
found.  Since, I realized that there was yet another case of two
malformations that it returned only one or the other of.

An input buffer may be too short to fully express the code point it
purports to.  This can be determined by the first byte of the UTF-8
sequence indicating a longer sequence is requred than the space
available.  But also, that shortened sequence can have a premature
beginning of another character earlier than the shortness.  This commit
causes these to be both raised, instead of the previous behavior of
noting just one.

6 years agoAPItest/t/utf8.t: Partially refactor to use table data
Karl Williamson [Wed, 23 Nov 2016 01:14:45 +0000 (18:14 -0700)]
APItest/t/utf8.t: Partially refactor to use table data

This removes kludgy code that was trying, given a partial
character, to determine if there enough bytes present to guarantee that
the whole character must belong to a class of characters or not.  Now
the necessary length to make that determination has instead manually
been placed in a table, so it can be looked up.  In doing so, I
corrected one length that was failing on EBCDIC.

6 years agoAPItest/t/utf8.t: Fix test
Karl Williamson [Wed, 23 Nov 2016 01:07:31 +0000 (18:07 -0700)]
APItest/t/utf8.t: Fix test

It turns out that this test has two malformations, and should only have
one; a future commit will remove the masking of the 2nd one.

6 years agoAPItest/t/utf8.t: Comments only
Karl Williamson [Wed, 23 Nov 2016 01:01:21 +0000 (18:01 -0700)]
APItest/t/utf8.t: Comments only

6 years agoAPItest/t/utf8.t: Add some indentation to diagnositcs
Karl Williamson [Wed, 23 Nov 2016 00:55:10 +0000 (17:55 -0700)]
APItest/t/utf8.t: Add some indentation to diagnositcs

This is so they don't interrupt reading the output when there are
errors.

6 years agoutf8.c: Clarify warning message.
Karl Williamson [Tue, 22 Nov 2016 20:15:18 +0000 (13:15 -0700)]
utf8.c: Clarify warning message.

This warning was changed recently in the 5.25 series, and has not been
in a stable release.

6 years agoAPItest/t/utf8.t: Simplify expression slightly
Karl Williamson [Mon, 21 Nov 2016 21:59:47 +0000 (14:59 -0700)]
APItest/t/utf8.t: Simplify expression slightly

6 years agoAPItest/t/handy.t: Output details if test fails
Karl Williamson [Sun, 20 Nov 2016 14:56:40 +0000 (07:56 -0700)]
APItest/t/handy.t: Output details if test fails

There should be no warnings generated, but if there are, we want to see
what they were.

6 years agoadd comments explaining the point of SVf_PROTECT
David Mitchell [Thu, 24 Nov 2016 14:42:27 +0000 (14:42 +0000)]
add comments explaining the point of SVf_PROTECT

The flag was added by v5.21.4-17-ga623f89, but outside of the commit
message itself, there didn't seem to be any explanation for this flag.

6 years agoPOSIX.pm: shut up g++ compiler warning
David Mitchell [Thu, 24 Nov 2016 13:52:30 +0000 (13:52 +0000)]
POSIX.pm: shut up g++ compiler warning

g++ is too stupid to know that strtoul(..,&unparsed,...) will modify
unparsed. So initialise it to NULL.

POSIX.xs: In function ‘void XS_POSIX_strtoul(PerlInterpreter*, CV*)’:
POSIX.xs:3468:17: warning: ‘unparsed’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                 if (unparsed)

6 years agoadd sv_set_undef() API function
David Mitchell [Thu, 24 Nov 2016 09:40:44 +0000 (09:40 +0000)]
add sv_set_undef() API function

This function is equivalent to sv_setsv(sv, &PL_sv_undef), but more
efficient.

Also change the obvious places in the core to use the new idiom.

6 years agoavoid premature free of referent in list assign
David Mitchell [Tue, 22 Nov 2016 16:41:54 +0000 (16:41 +0000)]
avoid premature free of referent in list assign

RT #130132

My recent commit v5.25.6-266-ga083329 made it so that perl could
sometimes avoid mortalising the referent when assigning to a reference
(e.g. for $ref1 = $ref2, where $$ref1 has a ref count of 1).

Unfortunately it turns out that list assign relied on this behaviour
to avoid premature freeing, e.g.

    ($ref1, $x) = ($y, $$ref1);

where $$ref1 needs to continue to live for at least the rest of the
assign.

This commit fixes it by mortalising the referent in pp_assign when
required.

6 years agoThis one goes up to 11
Chris 'BinGOs' Williams [Thu, 24 Nov 2016 11:49:29 +0000 (11:49 +0000)]
This one goes up to 11

6 years agoembed.fnc: Remove inappropriate pure attributes
Karl Williamson [Tue, 22 Nov 2016 18:30:28 +0000 (11:30 -0700)]
embed.fnc: Remove inappropriate pure attributes

In looking at the diffs from f6e4c377437f9b2ded79fb55f66983a6d4f761f9,
just committed, I realized that some of the functions marked pure,
really have side effects, if only initialization if not called
previously.  Still, the compiler could optimize things so it is wrong.
I then did a manual audit of embed.fnc, and removed the pure attribute
of the functions that I found that have some potential side effects.

6 years agoMake (P)ure funcs in embed.fnc imply (R)eturn must be checked
Andy Lester [Tue, 22 Nov 2016 13:17:45 +0000 (06:17 -0700)]
Make (P)ure funcs in embed.fnc imply (R)eturn must be checked

embed.fnc defines that a pure function is one that has no effects other
than its return value.  Therefore, calling such a function without using
the return value must be an error.

This patch makes a "P" "pure function" flag also imply the "R" "return
value must be checked" flag.

6 years agoConfigure: also zero out high bytes of 80-bit ldnan
Niko Tyni [Sat, 19 Nov 2016 07:45:45 +0000 (09:45 +0200)]
Configure: also zero out high bytes of 80-bit ldnan

These are currently zero anyway, but things are probably not guaranteed
to stay so.

6 years agoConfigure: fix garbage filtering with 80-bit long doubles
Niko Tyni [Fri, 18 Nov 2016 16:36:34 +0000 (18:36 +0200)]
Configure: fix garbage filtering with 80-bit long doubles

The test had several problems that resulted in the excess
bytes not getting zeroed out. This caused random contents in
$Config{longdblinfbytes}, observed on Debian with GCC 6.2.0 (but not
5.4.1).

Bug-Debian: https://bugs.debian.org/844752

6 years agoRecommend the quicker "make test_prep" for t/TEST usage.
Matthew Horsfall [Mon, 21 Nov 2016 14:07:21 +0000 (09:07 -0500)]
Recommend the quicker "make test_prep" for t/TEST usage.

6 years agoBump Module::CoreList version
Chad Granum [Sun, 20 Nov 2016 22:05:26 +0000 (14:05 -0800)]
Bump Module::CoreList version

6 years agoBump the perl version in various places for 5.25.8
Chad Granum [Sun, 20 Nov 2016 22:02:47 +0000 (14:02 -0800)]
Bump the perl version in various places for 5.25.8

6 years agonew perldelta
Chad Granum [Sun, 20 Nov 2016 21:30:09 +0000 (13:30 -0800)]
new perldelta

6 years agoUpdate epigraphs and release schedule
Chad Granum [Sun, 20 Nov 2016 21:29:08 +0000 (13:29 -0800)]
Update epigraphs and release schedule

6 years agoupdate t/porting/known_pod_issues.dat v5.25.7
Chad Granum [Sun, 20 Nov 2016 20:10:44 +0000 (12:10 -0800)]
update t/porting/known_pod_issues.dat

6 years agoUpdate perlhist.pod for 5.25.7
Chad Granum [Sun, 20 Nov 2016 19:21:53 +0000 (11:21 -0800)]
Update perlhist.pod for 5.25.7

6 years agoFinalize perldelta for 5.25.7
Chad Granum [Sun, 20 Nov 2016 19:17:09 +0000 (11:17 -0800)]
Finalize perldelta for 5.25.7

Following release manager doc

6 years agoUpdate Module::CoreLiast for 5.25.7
Chad Granum [Sun, 20 Nov 2016 18:51:39 +0000 (10:51 -0800)]
Update Module::CoreLiast for 5.25.7

6 years agoFix Module-CoreList version info for 5.25.7
Chad Granum [Sun, 20 Nov 2016 18:49:18 +0000 (10:49 -0800)]
Fix Module-CoreList version info for 5.25.7

6 years agoFinal manual updates to perldelta
Chad Granum [Sun, 20 Nov 2016 15:52:19 +0000 (07:52 -0800)]
Final manual updates to perldelta

This will still likeyl get minor changes in the rest of the release
process, but the pre-release editing is done.

6 years agoCorrect one POD formatting error in perldelta.
James E Keenan [Sun, 20 Nov 2016 17:28:15 +0000 (12:28 -0500)]
Correct one POD formatting error in perldelta.

This commit satisfies 'podchecker pod/perldelta.pod', but there remain
problems detected during t/porting/podcheck.t.

6 years agoperldelta fixes from khw
Karl Williamson [Sun, 20 Nov 2016 00:33:07 +0000 (17:33 -0700)]
perldelta fixes from khw

The ones I removed are so minor as to not be worth mentioning.

6 years agoPerldelta updates in prep for tomorrows release
Chad Granum [Sat, 19 Nov 2016 15:37:20 +0000 (07:37 -0800)]
Perldelta updates in prep for tomorrows release

6 years agoExtUtils::ParseXS: Rmv impediment to compiling under C++11
Karl Williamson [Fri, 18 Nov 2016 21:54:09 +0000 (14:54 -0700)]
ExtUtils::ParseXS: Rmv impediment to compiling under C++11

C++11 changed from earlier versions to require space between the end of
a string literal and a macro, so that a feature can unambiguously be
added to the language.  Starting in g++ 6.2, the compiler emits a
deprecation warning when there isn't a space (presumably so that future
versions can support C++11).

Although not required by the C++11 change, this patch also makes sure
there is space after a macro call, before a string literal.  This makes
the macro stand out, and is easier to read.

Code and modules included with the Perl core need to be compilable using
C++.  This is so that perl can be embedded in C++ programs. (Actually,
only the hdr files need to be so compilable, but it would be hard to
test that just the hdrs are compilable.)  So we need to accommodate
changes to the C++ language.

6 years agoData-Dumper: Rmv impediment to compiling under C++11
Karl Williamson [Fri, 18 Nov 2016 21:41:17 +0000 (14:41 -0700)]
Data-Dumper: Rmv impediment to compiling under C++11

C++11 changed from earlier versions to require space between the end of
a string literal and a macro, so that a feature can unambiguously be
added to the language.  Starting in g++ 6.2, the compiler emits a
deprecation warning when there isn't a space (presumably so that future
versions can support C++11).

Although not required by the C++11 change, this patch also makes sure
there is space after a macro call, before a string literal.  This makes
the macro stand out, and is easier to read.  As part of this, useless ""
following the macro are removed.

This patch also changes the affected lines to not exceed 79 columns, as
specified by perlhack.

Code and modules included with the Perl core need to be compilable using
C++.  This is so that perl can be embedded in C++ programs. (Actually,
only the hdr files need to be so compilable, but it would be hard to
test that just the hdrs are compilable.)  So we need to accommodate
changes to the C++ language.

6 years agoStorable: Rmv impediment to compiling under C++11
Karl Williamson [Fri, 18 Nov 2016 20:34:03 +0000 (13:34 -0700)]
Storable: Rmv impediment to compiling under C++11

C++11 changed from earlier versions to require space between the end of
a string literal and a macro, so that a feature can unambiguously be
added to the language.  Starting in g++ 6.2, the compiler emits a
deprecation warning when there isn't a space (presumably so that future
versions can support C++11).

Although not required by the C++11 change, this patch also makes sure
there is space after a macro call, before a string literal.  This makes
the macro stand out, and is easier to read.

This patch also changes the affected lines to not exceed 79 columns, as
specified by perlhack.

Code and modules included with the Perl core need to be compilable using
C++.  This is so that perl can be embedded in C++ programs. (Actually,
only the hdr files need to be so compilable, but it would be hard to
test that just the hdrs are compilable.)  So we need to accommodate
changes to the C++ language.

6 years agothreads.xs: Rmv impediment to compiling under C++11
Karl Williamson [Sat, 19 Nov 2016 12:32:57 +0000 (05:32 -0700)]
threads.xs: Rmv impediment to compiling under C++11

C++11 changed from earlier versions to require space between the end of
a string literal and a macro, so that a feature can unambiguously be
added to the language.  Starting in g++ 6.2, the compiler emits a
deprecation warning when there isn't a space (presumably so that future
versions can support C++11).

This patch also changes the affected line to not exceed 79 columns, as
specified by perlhack.

Code and modules included with the Perl core need to be compilable using
C++.  This is so that perl can be embedded in C++ programs. (Actually,
only the hdr files need to be so compilable, but it would be hard to
test that just the hdrs are compilable.)  So we need to accommodate
changes to the C++ language.

6 years agoTime-HiRes: Remove impediment to compiling under C++11
Karl Williamson [Fri, 18 Nov 2016 20:20:50 +0000 (13:20 -0700)]
Time-HiRes: Remove impediment to compiling under C++11

C++11 changed from earlier versions to require space between the end of
a string literal and a macro, so that a feature can unambiguously be
added to the language.  Starting in g++ 6.2, the compiler emits a
deprecation warning when there isn't a space (presumably so that future
versions can support C++11).

Although not required by the C++11 change, this patch also makes sure
there is space after a macro call, before a string literal.  This makes
the macro stand out, and is easier to read.

This patch also changes any affected lines that exceed 79 columns, as
specified by perlhack.

Code and modules included with the Perl core need to be compilable using
C++.  This is so that perl can be embedded in C++ programs. (Actually,
only the hdr files need to be so compilable, but it would be hard to
test that just the hdrs are compilable.)  So we need to accommodate
changes to the C++ language.

6 years agoCwd: Remove impediment to compiling under C++11
Karl Williamson [Fri, 18 Nov 2016 20:05:27 +0000 (13:05 -0700)]
Cwd: Remove impediment to compiling under C++11

C++11 changed from earlier versions to require space between the end of
a string literal and a macro, so that a feature can unambiguously be
added to the language.  Starting in g++ 6.2, the compiler emits a
warning when there isn't a space (presumably so that future versions can
support C++11).  This commit fixes Cwd

This patch also updates the Changes file with information missing from
the previous change to the module.

Code and modules included with the Perl core need to be compilable using
C++.  This is so that perl can be embedded in C++ programs. (Actually,
only the hdr files need to be so compilable, but it would be hard to
test that just the hdrs are compilable.)  So we need to accommodate
changes to the C++ language.

6 years agoMerge branch 'perlre-tidy' into blead
Aaron Crane [Sat, 19 Nov 2016 13:28:02 +0000 (13:28 +0000)]
Merge branch 'perlre-tidy' into blead

This branch makes assorted cleanups to pod/perlre.pod. In particular, it no
longer claims that long-established, stable regex constructs like (?:pat)
might stop working in the future.

6 years agoperlre: don't impugn the stability of all (?…) constructs
Aaron Crane [Sat, 19 Nov 2016 13:15:18 +0000 (13:15 +0000)]
perlre: don't impugn the stability of all (?…) constructs

Previously, the documentation suggested that any or all of these constructs
might disappear or be significantly changed without notice:

    (?#comment)
    (?m)
    (?^m)
    (?:group)
    (?m-s:group)
    (?^m:group)
    (?|branch|reset)
    (?=pos lookahead)
    (?!neg lookahead)
    (?<=pos lookbehind)
    (?<!neg lookbehind)
    (?<named>capture)
    (?'named'capture)
    \k<named_backref>
    \k'named_backref'
    (?{ code })
    (??{ postponed regex })
    (?1)
    (?-2)
    (?+2)
    (?R)
    (?0)
    (?&named_subpattern)
    (?(condition)consequent|alternate), including (?(DEFINE)defs)
    (?>independent subpattern)
    (?[ [ext] + [char] - [cls] ])

Of those features, the last one (extended bracketed character classes) is
specifically experimental in our formal sense; but it's not realistic to
think that future versions of Perl might break any of the others — many of
which date back as far as 5.000. Furthermore, even if that were likely
enough to be worth pointing out, it would be better to do so on each of the
affected constructs, rather than with an easier-to-miss blanket notice at
the top of the section.

Therefore, this change removes the blanket notice, and adds a note of
experimental status to the mention of extended bracketed character classes,
linking to our policy definition of what that means.

6 years agoperlre: summarise full syntax for (?(cond)then|else) constructs
Aaron Crane [Sat, 19 Nov 2016 13:10:51 +0000 (13:10 +0000)]
perlre: summarise full syntax for (?(cond)then|else) constructs

In the conditional-execution constructs, the condition is always syntactically
surrounded by a single pair of parens. The various constructs therefore show
that pair of parens in all cases; this seems like a good thing. In addition,
the summary for these constructs as a group also shows the parens; this also
seems like a good thing. But it's not immediately obvious that the two sets
of parens are the same.

Rather than trying to clarify the situation using complicated prose, just
show an example of the full syntax for each conditional construct.

6 years agoperlre: minor wordsmithing, POD formatting tweaks, etc
Aaron Crane [Sat, 19 Nov 2016 13:07:07 +0000 (13:07 +0000)]
perlre: minor wordsmithing, POD formatting tweaks, etc

6 years agoperlre: regularise list items
Aaron Crane [Sat, 19 Nov 2016 13:01:50 +0000 (13:01 +0000)]
perlre: regularise list items

- Only one list item per construct (and change inbound links)

- Consistently list forms with C<< <name> >> before those with C<< 'name' >>

6 years agoDocument the package for $REGMARK and $REGERROR
Aaron Crane [Sat, 19 Nov 2016 12:54:42 +0000 (12:54 +0000)]
Document the package for $REGMARK and $REGERROR

6 years agoChange white space to avoid C++ deprecation warning
Karl Williamson [Thu, 17 Nov 2016 13:21:54 +0000 (06:21 -0700)]
Change white space to avoid C++ deprecation warning

C++11 requires space between the end of a string literal and a macro, so
that a feature can unambiguously be added to the language.  Starting in
g++ 6.2, the compiler emits a warning when there isn't a space
(presumably so that future versions can support C++11).  Unfortunately
there are many such instances in the perl core.  This commit fixes
those, including those in ext/, but individual commits will be used for
the other modules, those in dist/ and cpan/.

This commit also inserts space at the end of a macro before a string
literal, even though that is not deprecated, and removes useless ""
literals following a macro (instead of inserting a blank).  The result
is easier to read, making the macro stand out, and be clearer as to the
intention.

Code and modules included with the Perl core need to be compilable using
C++.  This is so that perl can be embedded in C++ programs. (Actually,
only the hdr files need to be so compilable, but it would be hard to
test that just the hdrs are compilable.)  So we need to accommodate
changes to the C++ language.

6 years agoUse test.pl functions in t/op/groups.t
Dagfinn Ilmari Mannsåker [Fri, 18 Nov 2016 14:13:22 +0000 (14:13 +0000)]
Use test.pl functions in t/op/groups.t

The test file was already loading test.pl, but not using any functions
other than skip_all(_if_miniperl).  This ports the rest of the test to
using note(), skip() and ok().

Diff is best read with -w and --color-words or --word-diff.

6 years agot/op/groups.t: Add missing "nok 1"
Dan Collins [Fri, 30 Sep 2016 14:35:18 +0000 (10:35 -0400)]
t/op/groups.t: Add missing "nok 1"

For: RT #116775

6 years agoRemove code commented out since July 1996.
James E Keenan [Thu, 17 Nov 2016 23:01:13 +0000 (18:01 -0500)]
Remove code commented out since July 1996.

6 years agoAPItest/t/utf8.t: Fix failing EBCDIC tests
Karl Williamson [Thu, 17 Nov 2016 03:18:59 +0000 (20:18 -0700)]
APItest/t/utf8.t: Fix failing EBCDIC tests

I keep not getting this completely correct, hence
1069c57cb1f4e6b94f8695843243749e9511303e
162256f303e3b2f3936976e692650c18c9cad0a6

But I'm hopeful this is the final answer.  We should be operating on I8
strings in this function, translating into I8 at the beginning and
translating  back to UTF-EBCDIC at the end (except UTF8SKIP has
purposely been built for speed to not use the transform, so it operates
on UTF-EBCDIC.

6 years agoAPItest/t/utf8.t: Fill in missing die() reason
Karl Williamson [Thu, 17 Nov 2016 03:17:48 +0000 (20:17 -0700)]
APItest/t/utf8.t: Fill in missing die() reason

I forgot to complete this before the initial commit, so that the reason
for dieing was empty.

6 years agoop/bop.t: Fix test failing on EBCDIC
Karl Williamson [Thu, 17 Nov 2016 03:15:54 +0000 (20:15 -0700)]
op/bop.t: Fix test failing on EBCDIC

This recently added test did not take into account character set
differences.

6 years agoRemove spurious executable bit from Porting/pod_lib.pl
Dagfinn Ilmari Mannsåker [Thu, 17 Nov 2016 09:21:07 +0000 (09:21 +0000)]
Remove spurious executable bit from Porting/pod_lib.pl

6 years agoAccount for possibility of DOS file endings.
James E Keenan [Mon, 14 Nov 2016 22:22:22 +0000 (17:22 -0500)]
Account for possibility of DOS file endings.

Although our source code (including this file) is supposed to have only Unix
line endings, cloning, etc., can result in particular users having DOS line
endings.  Let's allow '\r\n' to avoid spurious testing or installation
problems.

For: RT #130088, as recommended by Mark E Renzulli (UTRC).

6 years agoTest descriptions should be one line or ./TEST chokes on them
Matthew Horsfall [Wed, 16 Nov 2016 13:31:00 +0000 (08:31 -0500)]
Test descriptions should be one line or ./TEST chokes on them

6 years agooptimise $ref1 = $ref2 better
David Mitchell [Tue, 15 Nov 2016 08:27:48 +0000 (08:27 +0000)]
optimise $ref1 = $ref2 better

When assigning to a ref, the old referent is mortalised if its refcount
is 1, to avoid a premature free on things like $r = $$r or $r = $r->[0].

For the shortcut case where $ref1 and $ref2 are simple refs (no magic etc)
it's possible to do the assign then SvREFCNT_dec() the old value without
having to mortalise it. Which is faster.

Even when it doesn't have to be mortalised (RC > 1) this commit makes it
slightly faster as it no longer calls sv_unref_flags().

Conversely, this commit also makes the short-cut integer assign code path
infinitesimally slower.

6 years agoperf/benchmarks: tidy scalar assign benchmarks
David Mitchell [Tue, 15 Nov 2016 08:22:48 +0000 (08:22 +0000)]
perf/benchmarks: tidy scalar assign benchmarks

rename them from expr::assign::* to expr::sassign::* so as to more easily
distinguish them from expr::aassign::, and move them to the correct place
in the file

6 years agoReport indented here-doc line errors correctly
Matthew Horsfall [Tue, 15 Nov 2016 12:41:51 +0000 (07:41 -0500)]
Report indented here-doc line errors correctly

6 years agoCleanup PERL_VERSION checks in .c files
Nicolas R [Sun, 13 Nov 2016 09:16:23 +0000 (02:16 -0700)]
Cleanup PERL_VERSION checks in .c files

This commit is removing code not exercised by blead
or any later versions using PERL_VERSION.
This is a noop, mainly cleaning code.

6 years agoRevert "Do not try to fchown() to uid -1 and gid -1."
Tony Cook [Tue, 15 Nov 2016 03:42:52 +0000 (14:42 +1100)]
Revert "Do not try to fchown() to uid -1 and gid -1."

This reverts commit c4f643b9fca4c4487ef74e4e6cd5b61a26025698, which
fixed a failure introduced by commit
f95ba548a286b17c260cc168715a9d0d441b14a6 which was reverted in
dd1dbff095629118e73a48a2a6008f03418a07f6.

(uid_t)(-1) and (gid_t)(-1) are perfectly valid parameters to
chown()/fchown() back to POSIX.1-2001 at least.

6 years agoavoid a declaration conflict on El Capitan with recent XCode
Tony Cook [Mon, 14 Nov 2016 23:15:42 +0000 (10:15 +1100)]
avoid a declaration conflict on El Capitan with recent XCode

OS X El Capitan doesn't implement the clock_gettime() or clock_getrez()
APIs, but recent versions of XCode, which are released to El Capitan
do include updated headers that declare those functions.

This causes errors like:

HiRes.xs:810:12: error: static declaration of 'clock_gettime' follows non-static
      declaration
static int clock_gettime(clockid_t clock_id, struct timespec *ts) {
           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:177:5: note:
      previous declaration is here
int clock_gettime(clockid_t __clock_id, struct timespec *__tp);
    ^
HiRes.xs:844:12: error: static declaration of 'clock_getres' follows non-static
      declaration
static int clock_getres(clockid_t clock_id, struct timespec *ts) {
           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:174:5: note:
      previous declaration is here
int clock_getres(clockid_t __clock_id, struct timespec *__res);
    ^
2 errors generated.

To avoid that, define the emulation functions with our own name
and use a macro to map the standard names to our implemnentations.

6 years agoFinish removing POSIX deprecated fcns
Karl Williamson [Mon, 14 Nov 2016 21:52:45 +0000 (22:52 +0100)]
Finish removing POSIX deprecated fcns

Commit 47ed9d9e89922a8e165d6dfc5737772cc5ee7a45 removed various
deprecated functions, as scheduled in this release, but failed to
include everything that should have gotten removed.

Spotted by Abigail.

6 years agoFix error message for unclosed \N{ in regcomp
Dagfinn Ilmari Mannsåker [Mon, 14 Nov 2016 19:05:31 +0000 (20:05 +0100)]
Fix error message for unclosed \N{ in regcomp

An unclosed \N{ that made it through to the regex engine rather than
being handled by the lexer would erroneously trigger the error for
"\N{NAME} must be resolved by the lexer".

This separates the check for the missing trailing } and issues the
correct error message for this.

6 years agotoke.c: remove obsolete comment
Lukas Mai [Mon, 14 Nov 2016 14:23:17 +0000 (15:23 +0100)]
toke.c: remove obsolete comment

6 years agoop.h: add parens around macro expansion
Lukas Mai [Mon, 14 Nov 2016 14:21:55 +0000 (15:21 +0100)]
op.h: add parens around macro expansion

6 years agot/porting/regen.t: be even more helpful when tests fail
Aaron Crane [Mon, 14 Nov 2016 14:24:30 +0000 (15:24 +0100)]
t/porting/regen.t: be even more helpful when tests fail

My code here was wrong; it wasn't reporting anything useful when some
dependencies of special regen scripts changed.

6 years agoDocument that symbols should be removed from metaconfig.h
Dagfinn Ilmari Mannsåker [Mon, 14 Nov 2016 14:13:58 +0000 (15:13 +0100)]
Document that symbols should be removed from metaconfig.h

6 years agoRemove all symbols from metaconfig.h
Dagfinn Ilmari Mannsåker [Mon, 14 Nov 2016 14:08:03 +0000 (15:08 +0100)]
Remove all symbols from metaconfig.h

Except BOOTSTRAP_CHARSET, which was removed from Configure in commit
1d38f63fe5, they're all used in the code, so metaconfig pulls them in
anyway.

6 years agoSilence deprecation warnings in tests
Matthew Horsfall [Mon, 14 Nov 2016 13:52:36 +0000 (08:52 -0500)]
Silence deprecation warnings in tests