This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
17 months agofeature.pm: Bump version number
Karl Williamson [Wed, 30 Nov 2022 15:45:42 +0000 (08:45 -0700)]
feature.pm: Bump version number

This is in preparation for the next commit

17 months agoBump B::Deparse VERSION
Paul "LeoNerd" Evans [Sun, 27 Nov 2022 15:47:20 +0000 (15:47 +0000)]
Bump B::Deparse VERSION

17 months agoDeparse.pm: Correctly handle signature //= and ||= params
Paul "LeoNerd" Evans [Sun, 27 Nov 2022 15:44:33 +0000 (15:44 +0000)]
Deparse.pm: Correctly handle signature //= and ||= params

17 months agopod2html: sort command-line switches
James E Keenan [Tue, 29 Nov 2022 20:52:25 +0000 (20:52 +0000)]
pod2html: sort command-line switches

The pod2html utility is the gateway to the function
Pod::Html::pod2html() exported from lib/Pod/Html.pm.  It is installed in
addition to the perl executable in 'make install' and is often packaged
separately in software distributions.  Over time, differences have crept
in to the way each file documents the command-line switches.  These
should be rectified.

As a first step toward more maintainable documentation, let's have
bin/pod2html present those switches in alphabetical order (albeit
interleaving the 'no*' switches) as lib/Pod/Html.pm already does.  This
weill permit us to more easily compare their respective documentation
sections.

17 months agoperl.c - move PL_restartop assert out of perl_run()
Yves Orton [Tue, 29 Nov 2022 11:00:31 +0000 (12:00 +0100)]
perl.c - move PL_restartop assert out of perl_run()

In dd66b1d793 we added an assert to perl_run() that PL_restartop should
never be true when perl_run() is called after perl_parse(). Looked at
from the point of the internals, which calls perl_parse() and perl_run()
exactly once, this made sense.

It turns out however that there is at least one XS module out there that
expects to be able to set PL_restartop and then call perl_run(). If that
works out for them then we shouldn't block it, as we aren't really
trying to say "perl_run() should never be called with PL_restartop set"
(at least this assert wasn't trying to say that really), we are trying
to assert "between the top level transition from perl_parse() to
perl_run() we shouldnt leak any PL_restartop".

One could argue the assert maybe should go at the end of perl_parse(),
but I chose to put it in Miniperl.pm and thus into perlmain.c and
miniperlmain.c as I am not certain that perl_parse() should never be
called with PL_restartop set already, and putting it in the main code
really does more closely reflect the intent of this assert anyway.

This was reported as Blead Breaks CPAN Github Issue #20557.

17 months agoregen.pl - add miniperlmain.pl, it is fast, and doesn't hurt
Yves Orton [Tue, 29 Nov 2022 10:58:20 +0000 (11:58 +0100)]
regen.pl - add miniperlmain.pl, it is fast, and doesn't hurt

I was surprised `make regen` didnt regenerate miniperlmain.pl,
given it is fast I see no reason we shouldn't do it as part of
the regen process.

17 months agoregen.pl - sort list of regen plug ins
Yves Orton [Tue, 29 Nov 2022 10:52:34 +0000 (11:52 +0100)]
regen.pl - sort list of regen plug ins

17 months agoReplace SvGROW with sv_grow_fresh in perl.c, pp_sys.c, toke.c
Richard Leach [Mon, 28 Nov 2022 13:28:46 +0000 (13:28 +0000)]
Replace SvGROW with sv_grow_fresh in perl.c, pp_sys.c, toke.c

Changed:
 * perl.c - Perl_moreswitches
 * pp_sys.c - pp_sysread
 * toke.c - Perl_scan_str

In each of the above functions, one instance of SvGROW on a new SVt_PV
can be swapped for the more efficient sv_grow_fresh. In two of the
instances, the calls used to create the the SVt_PV have also been
streamlined.

There should not be any functional change as a result of this commit.

17 months agoAdd missing "=item *"
Karl Williamson [Tue, 29 Nov 2022 20:12:37 +0000 (13:12 -0700)]
Add missing "=item *"

17 months agoREADME.cygwin: Note parallel compiling/testing is available
Karl Williamson [Fri, 25 Nov 2022 17:56:10 +0000 (10:56 -0700)]
README.cygwin: Note parallel compiling/testing is available

17 months agolocale.c: Fix memory leak
Karl Williamson [Fri, 25 Nov 2022 17:21:58 +0000 (10:21 -0700)]
locale.c: Fix memory leak

PL_C_locale_obj is a global variable, and should be allocated just once
per program.  Prior to this commit it could leak under MULTIPLICITY.

I was unable to get LSAN to notice this leak.  Tony Cook pointed out
that implementations are likely to use a single static object for this
extremely common scenario.  So no leak occurs.  Thus this commit only
fixes leaks on implementations using a different method, but does no
harm on the ones that use the static one.

17 months agoloc_tools.pl: Add sub to classify locales UTF-8 vs non
Karl Williamson [Fri, 25 Nov 2022 18:10:35 +0000 (11:10 -0700)]
loc_tools.pl: Add sub to classify locales UTF-8 vs non

The new sub taks a list of locales available on the platform and
separates the UTF-8 ones from the non-UTF-8 ones, returning two
sub-lists

17 months agoFix POSIX::strxfrm()
Karl Williamson [Fri, 12 Mar 2021 17:30:53 +0000 (10:30 -0700)]
Fix POSIX::strxfrm()

This commit does two things.

Most simply it extends strxfrm() to handle strings containing NUL
characters.  Previously the transformation stopped at the first NUL
encountered.

Second, it combines the implementation of this with the existing
implementation used for the 'cmp' operator, eliminating existing
discrepancies and preventing future ones.

This function takes an SV containing a PV.  The encoding of that
PV is based on the locale of the LC_CTYPE locale.  It really doesn't
make sense to collate based off of the sequencing of a different locale,
which prior to this commit it would do (but not for 'cmp') if the
LC_COLLATION locale were different.

As an example, consider the string:

  my $string = quotemeta join "", map { chr } (1..255);

and with LC_TYPE=8859-1 (Latin-1, used for several Western European
languages), LC_COLLATE set to ja_JP.utf8.  This doesn't make much sense,
outside of specialty uses such as a lazy implementation of a
Japanese/French dictionary, or for quoting snippets in one language in a
document written in the other.  ('lazy' because such text should really
be changing locales to the language of the snippet currently being
worked on.)  Nevertheless Perl should do something as sensible as
possible. and this commit changes POSIX::strxfrm() to use the method
already in use by the code implementing 'cmp'.  Prior to this commit,
POSIX::strxfrm($string) yielded on glibc 12.1:

^\3^\4^\5^\6^\a^\b^\t^\n^\13^\f^\r^\16^\17^\20^\21^\22^\23^\24^\25^\26^\27^\30^\31^\32^\e^\34^\35^\36^\37^ ^!^\"^#^\$^%^&^'^(^)^*^+^,^-^.^/^0^123456789:;^<^=^>^?^\@^A^BCDEFGHIJKLMNOPQRSTUVWXYZ[\\^]^^^_^`a^bcdefghijklmnopqrstuvwxyz{|^}^~^\177^\302\200^\302\201^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3^\3

These are effectively a sorting order, and it is not meant to be human
understandable.  But it is clear that most of the characters had the
same weight of 3, so a libc sort would mark them as ties in sorting
order.

And after,

 ^\3^\4^\5^\6^\a^\b^\t^\n^\13^\f^\r^\16^\17^\20^\21^\22^\23^\24^\25^\26^\27^\30^\31^\32^\e^\34^\35^\36^\37^ ^!^\"^#^\$^%^&^'^(^)^*^+^,^-^.^/^0^123456789:;^<^=^>^?^\@^A^BCDEFGHIJKLMNOPQRSTUVWXYZ[\\^]^^^_^`a^bcdefghijklmnopqrstuvwxyz{|^}^~^\177^\302\200^\302\201^\302\202^\302\203^\302\204^\302\205^\302\206^\302\207^\302\210^\302\211^\302\212^\302\213^\302\214^\302\215^\302\216^\302\217^\3\3^\3\3^\302\220^\302\221^\302\222^\302\223^\302\224^\302\225^\302\226^\302\227^\302\230^\302\231^\302\232^\302\233^\302\234^\302\235^\302\236^\302\237^\3\3^\341\257\211^\304\257^\304\260^\341\257\221^\3\3^\341\257\212^\304\266^\303\255^\341\257\216^\341\257\215^\3\3^\305\225^\3\3^\341\257\217^\341\257\203^\304\251^\304\234^\3\3^\3\3^\303\253^\3\3^\305\260^\3\3^\341\257\200^\3\3^\341\257\214^\3\3^\3\3^\3\3^\3\3^\341\257\213^\341\260\236^\341\260\235^\341\260\240^\341\260\246^\341\260\237^\341\260\245^\341\260\202^\341\260\252^\341\260\256^\341\260\255^\341\260\260^\341\260\257^\341\260\273^\341\260\272^\341\260\275^\341\260\274^\3\3^\341\261\213^\341\261\215^\341\261\214^\341\261\217^\341\261\223^\341\261\216^\304\235^\341\260\211^\341\261\236^\341\261\235^\341\261\240^\341\261\237^\341\261\255^\341\260\214^\341\260\232^\341\261\264^\341\261\263^\341\261\266^\341\261\274^\341\261\265^\341\261\273^\341\260\215^\341\262\200^\341\262\204^\341\262\203^\341\262\206^\341\262\205^\341\262\221^\341\262\220^\341\262\223^\341\262\222^\341\260\217^\341\262\240^\341\262\242^\341\262\241^\341\262\244^\341\262\250^\341\262\243^\304\236^\341\260\230^\341\262\263^\341\262\262^\341\262\265^\341\262\264^\341\263\202^\341\260\234^\341\263\203

which shows that most of the ties have been resolved, and hence the
results are more sensible

17 months agoTesting.pm: minor grammatical corrections and docs tidying
James E Keenan [Fri, 25 Nov 2022 21:53:30 +0000 (21:53 +0000)]
Testing.pm: minor grammatical corrections and docs tidying

17 months agoPod-Html auxiliary subroutines now imported only from Pod::Html::Util
James E Keenan [Fri, 25 Nov 2022 19:56:10 +0000 (19:56 +0000)]
Pod-Html auxiliary subroutines now imported only from Pod::Html::Util

As part of the refactoring of Pod-Html conducted during the 5.35/5.36
development cycle, three subroutines were moved from
ext/Pod-Html/lib/Pod/Html.pm to ext/Pod-Html/lib/Pod/Html/Util.pm. To allow
for the possibility that someone might have been importing any of these
subroutines from Pod::Html, in 5.36 we imported them from Pod::Html::Util and
allowed their re-exporting and noted in the documentation that this proviso
would be for 5.36 only (68327975be0).

As of 5.38 we can dispense with this proviso and remove the test file used to
exercise it as well.

Update pod/perldelta.pod as needed.  Keep porting tests happy.

17 months agoThe 'and' and 'or' ops are hardly 'new' anymore.
Matthew O. Persico [Mon, 28 Nov 2022 17:15:42 +0000 (12:15 -0500)]
The 'and' and 'or' ops are hardly 'new' anymore.

Committer: Matthew O. Persico is now a Perl author.

17 months agoskip checking categorization of libperl symbols for LTO builds
Tony Cook [Tue, 22 Nov 2022 22:04:07 +0000 (09:04 +1100)]
skip checking categorization of libperl symbols for LTO builds

For LTO builds with gcc and clang the PL_no_mem symbol as listed by
nm is flagged as "D" (writable data) and "T" (text, aka code)
respectively.

Looking at the final generated executable PL_no_mem does end up in
the .rodata (read only data) section, so it might be worth adding a
separate test for that.

Fixes #20518

17 months agolocale.c: Fix compilation error on some platforms
Karl Williamson [Sat, 26 Nov 2022 23:59:08 +0000 (16:59 -0700)]
locale.c: Fix compilation error on some platforms

Commit 73d66f354cd4df0324b11e46af48f66bd5c1dd15 introduced a compilation
error into some platforms lacking nl_langinfo(3)  (generally Windows,
but their compiler is more lenient in this regard.

Simply add a 'const' to the declaration to fix it.

17 months agoRecognise `//=` and `||=` syntax in signature parameter defaults
Paul "LeoNerd" Evans [Sat, 19 Nov 2022 11:48:19 +0000 (11:48 +0000)]
Recognise `//=` and `||=` syntax in signature parameter defaults

These create parameters where the default expression is assigned
whenever the caller did not pass a defined (or true) value. I.e. both if
it is missing, or is present but undef (or false).

17 months agoRemove obsolete workaround for VAX errno macros
Craig A. Berry [Thu, 24 Nov 2022 17:23:44 +0000 (11:23 -0600)]
Remove obsolete workaround for VAX errno macros

We won't be missing these from errno.h for any CRTL in this century
and it was always not quite right (but harmlessly redundant) to
use the workaround for non-Alpha since if we didn't need it for
Alpha then we also didn't need it for any post-Alpha architecture.

17 months agoutil.c - clarify unusual use of rcpv_new()
Yves Orton [Tue, 22 Nov 2022 14:56:31 +0000 (15:56 +0100)]
util.c - clarify unusual use of rcpv_new()

17 months agoop.c - add support for empty RCPV strings.
Yves Orton [Tue, 22 Nov 2022 14:41:14 +0000 (15:41 +0100)]
op.c - add support for empty RCPV strings.

Currently we have no need for an empty shared string, but there is no
reason it should not be possible. This patch reworks the internals so it
is possible to create one without triggering asserts. Currently we don't
use this, but it seems reasonable that someone might want it in the
future. Under DEBUGGING we will still assert if someone tries to create
an empty RCPV unless the flag specifies it should be allowed.

At the same time the docs for rcpv_new() have been cleaned up a bit to
be more correct and reflect what actually happens inside.

This changes things so that the len member of the RCPV structure is
always non-zero in a well formed structure by accounting for the null
we add to the end explicitly. The RCPV_LEN() macro continues to return
the old value (not including the null).

17 months agopp_ctl.c - don't let the current cop_file end up empty in @INC hooks
Yves Orton [Tue, 22 Nov 2022 14:39:51 +0000 (15:39 +0100)]
pp_ctl.c - don't let the current cop_file end up empty in @INC hooks

17 months agot/op/readline.t: skip error handling checks on solaris with PERLIO=stdio
Tony Cook [Mon, 21 Nov 2022 03:15:48 +0000 (14:15 +1100)]
t/op/readline.t: skip error handling checks on solaris with PERLIO=stdio

In this test, readline() calls down into PerlIOStdio_read(), which
uses fgetc() for a single character read, which fails as expected.

But fgetc() doesn't set the error flag on the stream, so the error
flag test and the close() test fail.

So skip the tests.

17 months agoperldelta for 12c7085de6f5
Tony Cook [Tue, 22 Nov 2022 23:38:52 +0000 (10:38 +1100)]
perldelta for 12c7085de6f5

17 months agoFix XS modules (e.g., Function::Parameters) that create anonsubs.
Felipe Gasper [Mon, 21 Nov 2022 15:26:52 +0000 (10:26 -0500)]
Fix XS modules (e.g., Function::Parameters) that create anonsubs.

Issue #20384: Commit 20d507b5869b116c3b1f8aeea48fbfbf68dfce60 broke
CPAN’s Function::Parameters. This updates that logic to (hopefully)
differentiate OP_ANONCODE from an XS module versus from Perl.

17 months agoext/XS-APItest/APItest.pm: Bump $VERSION
James E Keenan [Mon, 21 Nov 2022 22:35:51 +0000 (22:35 +0000)]
ext/XS-APItest/APItest.pm: Bump $VERSION

Oversight in b17e77fbd8

18 months agoPERL_STRLEN_NEW_MIN - increase to multiple of pointer sizes
Richard Leach [Sat, 19 Nov 2022 22:57:15 +0000 (22:57 +0000)]
PERL_STRLEN_NEW_MIN - increase to multiple of pointer sizes

Major malloc implementations, including the popular dlmalloc
derivatives all return chunks of memory that are a multiple of
the platform's pointer size. Perl's traditional default string
allocation of 10 bytes will almost certainly result in a larger
allocation than requested. Consequently, the interpreter may try
to Renew() an allocation to increase the PV buffer size when it
does not actually need to do so.

This commit increases the default string size to the nearest
pointer multiple. (12 bytes for 32-bit pointers, 16 bytes for
64-bit pointers). This is almost certainly unnecessarily small
for 64-bit platforms, since most common malloc implementations
seem to return 3*pointer size (i.e. 24 bytes) as the smallest
allocation. However, 16 bytes was chosen to prevent an increase
in memory usage in memory-constrained platforms which might have
a smaller minimum memory allocation.

18 months agoExtract minimum PV buffer/AV element size to common definitions
Richard Leach [Tue, 8 Nov 2022 23:40:06 +0000 (23:40 +0000)]
Extract minimum PV buffer/AV element size to common definitions

In a nutshell, for a long time the minimum PV length (hardcoded
in Perl_sv_grow) has been 10 bytes and the minimum AV array size
(hardcoded in av_extend_guts) has been 4 elements.

These numbers have been used elsewhere for consistency (e.g.
Perl_sv_grow_fresh) in the past couple of development cycles.
Having a standard definition, rather than hardcoding in multiple
places, is more maintainable. This commit therefore introduces
into perl.h:

    PERL_ARRAY_NEW_MIN_KEY
    PERL_STRLEN_NEW_MIN

(Note: Subsequent commit(s) will actually change the values.)

18 months agotest SvPVbyte*() and SvPVutf8*() variants set len
Tony Cook [Tue, 15 Nov 2022 00:00:47 +0000 (11:00 +1100)]
test SvPVbyte*() and SvPVutf8*() variants set len

These macros have limited use in core:

- only Socket uses SvPVbyte_nomg()
- nothing uses SvPVutf8_nomg()

Update the existing tests to ensure len is set properly.

Related to #20507

18 months agoPrepare Module::Corelist for 5.37.7
Max Maischein [Sun, 20 Nov 2022 13:05:16 +0000 (14:05 +0100)]
Prepare Module::Corelist for 5.37.7

18 months agoBump the perl version in various places for 5.37.6
Max Maischein [Sun, 20 Nov 2022 12:40:58 +0000 (13:40 +0100)]
Bump the perl version in various places for 5.37.6

18 months agoadd epigraph for 5.37.6
Max Maischein [Sun, 20 Nov 2022 12:35:27 +0000 (13:35 +0100)]
add epigraph for 5.37.6

18 months agoNew perldelta for 5.37.7
Max Maischein [Sun, 20 Nov 2022 12:32:53 +0000 (13:32 +0100)]
New perldelta for 5.37.7

18 months agoUpdate release schedule for 5.37.6
Max Maischein [Sun, 20 Nov 2022 12:26:42 +0000 (13:26 +0100)]
Update release schedule for 5.37.6

18 months agoParseXS - Disable alias value collision warnings by default
Yves Orton [Wed, 16 Nov 2022 10:14:55 +0000 (11:14 +0100)]
ParseXS - Disable alias value collision warnings by default

We always had a bug with the value 0, when fixing it, we discovered a lot
of people were doing duplicate aliases with 0. This patch disables the warnings
except when in a special author mode, as it makes no sense to show these warnings
to end users. It would seem most times creating such aliases is not an issue and
is entirely deliberate. So showing such warnings only to module authors and only
on request also makes sense.

18 months agoAdd new release to perlhist v5.37.6
Max Maischein [Sun, 20 Nov 2022 10:30:49 +0000 (11:30 +0100)]
Add new release to perlhist

18 months agoupdate perldelta for 5.37.6
Max Maischein [Sun, 20 Nov 2022 10:12:34 +0000 (11:12 +0100)]
update perldelta for 5.37.6

18 months agoUpdate Module::CoreList for 5.37.6
Max Maischein [Sun, 20 Nov 2022 09:36:10 +0000 (10:36 +0100)]
Update Module::CoreList for 5.37.6

18 months agolocale.c: Don't Safefree temps
Karl Williamson [Sun, 20 Nov 2022 04:01:22 +0000 (21:01 -0700)]
locale.c: Don't Safefree temps

Commit 22392ba2f8a changed the querylocale_foo macros to return a
mortalized copy instead of having to free things explicitly.  This was
done because the various code paths are complicated, and I was noticing
various leaks that would require a bunch of #ifdef's to fix.

That commit meant that all the existing free's of the results needed to
be removed.  This one was overlooked at the time.  Reported in
<f47046d6-7e35-301d-10f-9160b34ca2b6@uwe-dueffert.de>, not in github

18 months agoDevel::PPPort/module3: eliminate the always true warning for the return
Tony Cook [Thu, 17 Nov 2022 22:49:55 +0000 (09:49 +1100)]
Devel::PPPort/module3: eliminate the always true warning for the return

In this case we're testing that the result is always true, and it
happens the compiler realizes that the return value is always true,
even in isolation.

Returning the variable that we've already set to point to
PL_bufptr eliminates the warning.

The compiler is still smart enough to eliminate the comparison
on optimized builds.  Some linter may still complain about it.

18 months agoGvNAME() always returns a true value
Tony Cook [Thu, 17 Nov 2022 03:42:36 +0000 (14:42 +1100)]
GvNAME() always returns a true value

gcc 12 was complaining that GvNAME() always returns a true value,
and that's also true.

Omit such uses in conditions.

18 months agochange HvENAME_HEK() to HvENAME_HEK_NN() where NULLs would crash anyway
Tony Cook [Thu, 17 Nov 2022 03:41:35 +0000 (14:41 +1100)]
change HvENAME_HEK() to HvENAME_HEK_NN() where NULLs would crash anyway

gcc 12 was producing a confusing message complaining that
references to with hek_key[] were beyond the end of the array,
even though a properly HEK has bytes beyond the first we declare.

From experimentation I theorize the confusing message was produced
because HvENAME_HEK() can return a NULL pointer, and the array
pointed to by any NULL pointer is zero length, producing the
array bounds warning we were seeing.

Fixed by changing each hv_(fetch|delete)hek() call to use the
HvENAME_HEK_NN() macro variant, which doesn't include an explicit
NULL return value.

mro_method_changed_in() was a bit special, it evaluated the
hv_fetchhek() before the check for an anonymous stash, so I reordered
the code to take advantage of C99, checking the assertions before we
dereference the stash pointer, checking we have a name before trying
to look it up.

18 months agoonly fully calculate the stash (effective) name where needed
Tony Cook [Thu, 17 Nov 2022 03:30:39 +0000 (14:30 +1100)]
only fully calculate the stash (effective) name where needed

gcc 12 was complaining that evaluating (somehekptr)->hek_key
was always true in many places where HvNAME() or HvENAME() was
being called in boolean context.

Add new macros to check whether the names should be available and
use those instead.

18 months agoclarify that every tag is required to be annotated
Andreas Koenig [Tue, 15 Nov 2022 04:57:13 +0000 (05:57 +0100)]
clarify that every tag is required to be annotated
- while the instructions were already clear at this point, accidents with lightweight (unannotated) tags have happened

18 months agorelax the assertion in SSPTR() and SSPTRt()
Tony Cook [Mon, 14 Nov 2022 03:00:38 +0000 (14:00 +1100)]
relax the assertion in SSPTR() and SSPTRt()

I added assertions in SSPTR() and SSPTRt() to try to ensure the new
SSize_t result from SSNEW*() wouldn't be truncated, but this
was too strict, requiring that the size matched exactly.

Relax this to allow the input offset to be the same or larger than
SSize_t.

Fixes #20504.

18 months agoSkip one test under miniperl
James E Keenan [Fri, 18 Nov 2022 14:39:10 +0000 (14:39 +0000)]
Skip one test under miniperl

threads module not yet available.

For: # https://github.com/Perl/perl5/issues/20524

18 months agodist/Tie-File/t/29a_upcopy.t: double timeout to 10
David Mitchell [Fri, 18 Nov 2022 10:07:24 +0000 (10:07 +0000)]
dist/Tie-File/t/29a_upcopy.t: double timeout to 10

Some of these tests (which involve moving blocks of data around in a
file) are occasionally randomly timing out on some slow smokers.
Double the timeout from 5s to 10s and see if the problem goes away.

18 months agodist/Tie-File/t/29a_upcopy.t add test descriptions
David Mitchell [Fri, 18 Nov 2022 10:05:32 +0000 (10:05 +0000)]
dist/Tie-File/t/29a_upcopy.t add test descriptions

18 months agoGetopt::Long: synch with CPAN version 2.54
Johan Vromans [Fri, 18 Nov 2022 00:02:18 +0000 (00:02 +0000)]
Getopt::Long: synch with CPAN version 2.54

From Changes:

* Fix compatibility with Perl 5.8.

18 months agoGetopt::Long: sync with CPAN version 2.53
Johan Vromans [Thu, 17 Nov 2022 00:19:16 +0000 (00:19 +0000)]
Getopt::Long: sync with CPAN version 2.53

From Changes:

* Improve parsing of float numbers.
  https://rt.cpan.org/Ticket/Display.html?id=133216

* Fix Version/HelpMessage -message argument.
  https://rt.cpan.org/Ticket/Display.html?id=133963

* Added 'starter' method to the callback object. This method returns the
  starter (e.g. '--' or '-') of the option as used by the user.

* Fix problem with Pod::Usage argument in examples/skel2.pl.

* Enhanced option:default spec to octal, hex and binary.

18 months agoFix & test useless-anonymous-subroutine warnings.
Felipe Gasper [Wed, 9 Nov 2022 18:58:12 +0000 (13:58 -0500)]
Fix & test useless-anonymous-subroutine warnings.

Issue #20384: This fixes a breakage from
35458d36d3c9fcf47064e4379e15276057b0bca5 that Devel::WatchVars’s test suite
caught. A test is added to Perl’s own test suite to prevent regressions.

18 months agoFail attempts to pass anonsub to \$ prototype.
Felipe Gasper [Mon, 31 Oct 2022 20:34:11 +0000 (16:34 -0400)]
Fail attempts to pass anonsub to \$ prototype.

Issue #20384

18 months agoParseXS - version bump to 3.48 and test perlxs.pod has the right version
Yves Orton [Tue, 8 Nov 2022 16:44:11 +0000 (17:44 +0100)]
ParseXS - version bump to 3.48 and test perlxs.pod has the right version

The version in the pod has been long wrong. We are on 3.48 now, it was 3.13_01.

18 months agoParseXS - make testing easier
Yves Orton [Mon, 14 Nov 2022 17:46:11 +0000 (18:46 +0100)]
ParseXS - make testing easier

Use warn instead of print STDERR, and provide a way to make
errors trigger a die instead of an exit(1).

Currently the module code is written as though the only way
it will be used is via the xsubpp script, so the library does
annoying things like calling exit() instead of die() to signal
an exception. It also uses print STDERR instead of warn,
which means the test code can't just use a $SIG{__WARN__} hook
to see its warnings, and instead has to include PrimitiveCapture
in the t directory. These two things combine annoyingly in our
test code such that when you break the module you can see tests
exiting early, but with no useful diagnostics as to why.

This patch reworks this to use "warn" instead of print STDERR,
and to provide a way to enable the use of "die" instead of exit.
Thus making debugging failing tests far easier.

18 months agoParseXS - add support for elifdef and elifndef
Yves Orton [Mon, 14 Nov 2022 10:16:40 +0000 (11:16 +0100)]
ParseXS - add support for elifdef and elifndef

The upcoming C++23 and C23 standards add #elifdef, #elifndef.

18 months agoParseXS - allow symbolic alias of default function
Yves Orton [Tue, 8 Nov 2022 17:31:01 +0000 (18:31 +0100)]
ParseXS - allow symbolic alias of default function

Also normalize warnings. It used to be if you created an alias
of the root function (0) no warning would be produced. Now
we will produce a warning, but we also allow symbolic references
to defuse the warning.

18 months agoParseXS - better support for duplicate ALIASes
Yves Orton [Tue, 8 Nov 2022 16:40:09 +0000 (17:40 +0100)]
ParseXS - better support for duplicate ALIASes

Sometimes you *want* to create multiple names for the same
functionality, but doing so with the ALIAS functionality requires
awkward workarounds. This adds a new "symbolic alias" that does
not warn on dupes as creating a dupe is its whole point. For a
symbolic alias the value is the name of an existing alias.

This also cleans up some of the warnings related to aliases so
we distinguish between when a duplicate is truly ignored or
where it overrides a previous value. And deal with a few other
edge cases properly.

18 months agoParseXS - handle #else and #endif without blank line prefixes
Yves Orton [Tue, 8 Nov 2022 14:06:17 +0000 (15:06 +0100)]
ParseXS - handle #else and #endif without blank line prefixes

This patch makes it possible to omit some of the whitespace around
preprocessor directives. It teaches fetch_para() to understand
that a #else or #endif directive that does not end a #if that
was seen in the current "paragraph" should not be parsed as part
of that paragraph. This means that a conditional block that defines
the same sub under different define conditions need not have extra
whitespace after each sub definition.

18 months agoParseXS - sort things that might produce output
Yves Orton [Tue, 8 Nov 2022 13:58:04 +0000 (14:58 +0100)]
ParseXS - sort things that might produce output

Make sure our output is deterministic.

18 months agoconfigure.gnu forwards extra arguments to Configure
Tony Cook [Mon, 14 Nov 2022 00:20:15 +0000 (11:20 +1100)]
configure.gnu forwards extra arguments to Configure

except when it doesn't (the -- arguments)

This came up during discussion of #20502, but is not a fix for it.

18 months agoWhitespace alignment fix in regen/feature.pl
Paul "LeoNerd" Evans [Mon, 14 Nov 2022 15:04:14 +0000 (15:04 +0000)]
Whitespace alignment fix in regen/feature.pl

18 months agoUpdate AUTHORS and .mailmap with my (Mattia Barbon) current address
Mattia Barbon [Mon, 14 Nov 2022 09:13:21 +0000 (10:13 +0100)]
Update AUTHORS and .mailmap with my (Mattia Barbon) current address

18 months agoSvPVutf8_nomg - assign string length to the len parameter
Mattia Barbon [Sun, 13 Nov 2022 22:33:50 +0000 (23:33 +0100)]
SvPVutf8_nomg - assign string length to the len parameter

This is consistent with other SvPV* variants that take a len parameter.

18 months agoutf8::upgrade: Don't coerce undef arg
Karl Williamson [Fri, 28 Oct 2022 14:48:37 +0000 (08:48 -0600)]
utf8::upgrade: Don't coerce undef arg

This fixes GH #20419

18 months agoFigure out I32df, U32uf, etc. in Configure rather than in perl.h
TAKAI Kousuke [Tue, 18 Oct 2022 13:46:11 +0000 (22:46 +0900)]
Figure out I32df, U32uf, etc. in Configure rather than in perl.h

These macros were defined in perl.h using preprocessor conditionals,
but determining wheter I32 is "int" or "long" is pretty hard with
preprocessor, when INTSIZE == LONGSIZE.  The Configure script
should know exact underlying type of I32, so it should be able to
determine whether %d or %ld shall be used to format I32 value
more robustly.

Various pre-configured files, such as uconfig.h, are updated to
align with this.

18 months agoPerl doesn't appear to be included in the ibb any more
Tony Cook [Mon, 14 Nov 2022 00:02:06 +0000 (11:02 +1100)]
Perl doesn't appear to be included in the ibb any more

The "ibb-perl" link prompts for a login, though other links like
"https://hackerone.com/perl" load without a login.

Perl also isn't listed under the ibb project itself at
"https://hackerone.com/ibb?type=team"

18 months agoTie-File: report test timeouts to STDERR
David Mitchell [Sat, 12 Nov 2022 09:16:04 +0000 (09:16 +0000)]
Tie-File: report test timeouts to STDERR

Currently some tests have a 5 second timeout. If this is exceeded,
the test number is output as "not ok", along with "# Timeout" to
STDOUT. Change the latter to output to STDERR along with the test
filename and test number, for easer debugging of smoke logs.

(Really these test files need upgrading to use Test::* but that's a job
for another day and another person....)

18 months agoskip testing .github/README.md if doesn't appear to be a README
Tony Cook [Fri, 11 Nov 2022 04:53:12 +0000 (15:53 +1100)]
skip testing .github/README.md if doesn't appear to be a README

git on windows at least of 2.37.1 does not checkout symbolic links
as symbolic links, leaving them as files containing the filename
linked to.

This meant this test against .github/README.md failed, since it only
contained "../README": nothing that appears to be a copyright message

I considered testing that .github/README.md was a symbolic link
but 8975221916 suggests that it may eventually become more distinct
from the root README file, so instead check its size.

18 months agoregcomp.c - add a PARNO() macro to wrap the ARG() macro
Yves Orton [Fri, 4 Nov 2022 17:18:49 +0000 (18:18 +0100)]
regcomp.c - add a PARNO() macro to wrap the ARG() macro

We used the ARG() macro to access the parno data for the OPEN
and CLOSE regops. This made it difficult to find what needed to
change when the type and size or location of this data in the
node was modified. Replacing this access with a specific macro
makes the code more legible and future proof.

This was actually backported from finding everything that broke
by changing the regnode type for OPEN and CLOSE to 2L and moving
the paren parameter to the 2L slot. We might do something like this
in the future and separating the PARNO() macros from their
implementation will make it easier.

18 months agoregcomp.c - correct comment
Yves Orton [Fri, 4 Nov 2022 17:27:23 +0000 (18:27 +0100)]
regcomp.c - correct comment

18 months agoDevel-PPPort: bump version
Graham Knop [Fri, 4 Nov 2022 04:45:07 +0000 (05:45 +0100)]
Devel-PPPort: bump version

18 months agoDevel-PPPort: fix STMT_START and STMT_END to not warn on clang
Graham Knop [Fri, 4 Nov 2022 04:33:30 +0000 (05:33 +0100)]
Devel-PPPort: fix STMT_START and STMT_END to not warn on clang

Since 7169efc77525df70484a824bff4ceebd1fafc760, perl's core STMT_START
and STMT_END macros no longer try to use brace groups, due to the
warnings they can generate and their very limited usefulness.

That commit also changed Devel::PPPort to remove the use of brace groups
in STMT_START/STMT_END. That led to errors in older perls, so it was
partly reverted in e08ee3cb66f362c4901846a46014cfdfcd60326c. Since then,
various other macros have been improved to properly work with brace
groups enabled or disabled.

We can now remove the brace group using variant of STMT_START/STMT_END,
which will silence the warnings from clang.

18 months agoDevel-PPPort: use inline function for croak_sv without brace groups
Graham Knop [Fri, 4 Nov 2022 04:27:41 +0000 (05:27 +0100)]
Devel-PPPort: use inline function for croak_sv without brace groups

The macro for croak_sv when brace groups are not enabled uses
STMT_START/STMT_END. This works when used as a statement, but would
break if used as part of an expression.

To resolve this, change that macro to use a function. As a static inline
function with a namespaced name, it shouldn't cause problems with
namespace pollution.

18 months agopod/perlhacks.pod - document TEST_ARGS and make win32 perl use it too
Yves Orton [Thu, 3 Nov 2022 18:50:48 +0000 (19:50 +0100)]
pod/perlhacks.pod - document TEST_ARGS and make win32 perl use it too

Win32 has had TEST_SWITCHES and TEST_FILES for ages. Unix has
TEST_ARGS. This extends Win32 to support TEST_ARGS as well. I
havent made the contrary change to the unix code, anyone using
TEST_SWITCHES is already using it on Win32.

18 months agoParseXS - fix todo tests to match the correct filename
Yves Orton [Tue, 8 Nov 2022 13:43:01 +0000 (14:43 +0100)]
ParseXS - fix todo tests to match the correct filename

The original regex was off and showed this test as passing when
it was actually failing, which is what we expect and why the test
is marked as TODO. The test accidentally doubled the extension
expected in the filename, and this patch corrects that mistake.

18 months agoperldelta for 545d499045, 42d0708bf6, a1aa0ce9693, 4f8b3850b207
Tony Cook [Mon, 7 Nov 2022 23:39:44 +0000 (10:39 +1100)]
perldelta for 545d49904542d0708bf6a1aa0ce96934f8b3850b207

18 months agobump $Storable::VERSION
Tony Cook [Mon, 25 Jul 2022 06:53:41 +0000 (16:53 +1000)]
bump $Storable::VERSION

18 months agomake store_hook() handle regular expression objects
Tony Cook [Mon, 25 Jul 2022 04:53:39 +0000 (14:53 +1000)]
make store_hook() handle regular expression objects

Previously this would complain it didn't know the object type
when preparing to call STORABLE_freeze.

18 months agoimprove error reporting by store_hook() on an unknown type
Tony Cook [Tue, 19 Jul 2022 05:58:35 +0000 (15:58 +1000)]
improve error reporting by store_hook() on an unknown type

This produced an opaque message when it was asked to freeze an
object of an unsupported type.  Changes:

- replace the opaque internal object type number with the typical perl name of the
  type ("GLOB" instead of "8")
- include the class of the object being frozen to identify which class needs work
- include name of the function we're trying to call to do the freeze,
  if possible

18 months agoallow porting/corelist.t to be run from root
Yves Orton [Mon, 24 Oct 2022 07:45:55 +0000 (09:45 +0200)]
allow porting/corelist.t to be run from root

18 months agoTest case where different functions are declared
James E Keenan [Mon, 4 Jul 2022 21:02:01 +0000 (21:02 +0000)]
Test case where different functions are declared

In the first sample .xs file supplied for this branch, a function named
'dbh' was declared twice, once inside an 'ifdef', once outside.  This
led me to think that that dual use of the string 'dbh' was the problem
EUPXS was stumbling upon.

However, that appears to be incorrect.  If we supply a second sample .xs
file in which we use two different function names, we still get the
undesired warning.

18 months agoAdd TODO-ed test for duplicate warning
James E Keenan [Mon, 4 Jul 2022 15:12:17 +0000 (15:12 +0000)]
Add TODO-ed test for duplicate warning

18 months agoAdd test file contributed in GH 19661
E. Choroba [Mon, 4 Jul 2022 14:14:19 +0000 (14:14 +0000)]
Add test file contributed in GH 19661

18 months agobuildtoc: Add error check
Karl Williamson [Wed, 2 Nov 2022 19:39:55 +0000 (13:39 -0600)]
buildtoc: Add error check

If something goes wrong, this wouldn't have known it

18 months agoUpdate Data::Dumper synopsis
Elvin Aslanov [Fri, 2 Sep 2022 15:09:18 +0000 (19:09 +0400)]
Update Data::Dumper synopsis

Add `my` to synopsis.

Committer: Data-Dumper: Update $VERSION in POD.  The release date no
longer appears in the POD, so let's remove the comment admonishing us to
update it.

For: https://github.com/Perl/perl5/pull/20224

18 months agoregen/regcomp.pl - add more detail on what the script does and list its inputs properly
Yves Orton [Mon, 12 Sep 2022 09:30:15 +0000 (11:30 +0200)]
regen/regcomp.pl - add more detail on what the script does and list its inputs properly

Previously we were only showing one of the inputs that generates
regnodes.h, now we show all of them. Also add some paragraphs explaining
a bit more detail what the files contain and how we process.

Committer: Small grammatical correction, per
https://github.com/Perl/perl5/pull/20288#discussion_r968344745

18 months agoGenerate opcode.h, opnames.h
Branislav Zahradník [Fri, 4 Nov 2022 18:39:08 +0000 (19:39 +0100)]
Generate opcode.h, opnames.h

18 months agoRefactor opcode.pl - with c99 array init index comments are not necessary
Branislav Zahradník [Mon, 17 Oct 2022 05:43:07 +0000 (07:43 +0200)]
Refactor opcode.pl - with c99 array init index comments are not necessary

18 months agoRefactor opcode.pl - use c99 array initialization (using op enum)
Branislav Zahradník [Sun, 16 Oct 2022 17:59:38 +0000 (19:59 +0200)]
Refactor opcode.pl - use c99 array initialization (using op enum)

18 months agoRefactor opcode.pl - use INIT() macro instead of #ifdef/#endif
Branislav Zahradník [Sun, 16 Oct 2022 16:46:11 +0000 (18:46 +0200)]
Refactor opcode.pl - use INIT() macro instead of #ifdef/#endif

18 months agoRefactor opcode.pl - let INIT() macro to accept expressions with comma(s)
Branislav Zahradník [Sun, 16 Oct 2022 17:48:56 +0000 (19:48 +0200)]
Refactor opcode.pl - let INIT() macro to accept expressions with comma(s)

18 months agoRefactor opcode.pl - B/Op_private.pm - move generator code to function
Branislav Zahradník [Sun, 16 Oct 2022 15:00:51 +0000 (17:00 +0200)]
Refactor opcode.pl - B/Op_private.pm - move generator code to function

18 months agoRefactor opcode.pl - pp_proto.h - move generator code to function
Branislav Zahradník [Sun, 16 Oct 2022 14:11:29 +0000 (16:11 +0200)]
Refactor opcode.pl - pp_proto.h - move generator code to function

18 months agoRefactor opcode.pl - opnames.h - unglobalize output handle
Branislav Zahradník [Sun, 16 Oct 2022 10:51:48 +0000 (12:51 +0200)]
Refactor opcode.pl - opnames.h - unglobalize output handle

18 months agoRefactor opcode.pl - opnames.h - move epilogue into function
Branislav Zahradník [Sun, 16 Oct 2022 10:47:24 +0000 (12:47 +0200)]
Refactor opcode.pl - opnames.h - move epilogue into function

18 months agoRefactor opcode.pl - opnames.h - move opcode predicates into function
Branislav Zahradník [Sun, 16 Oct 2022 10:02:29 +0000 (12:02 +0200)]
Refactor opcode.pl - opnames.h - move opcode predicates into function

18 months agoRefactor opcode.pl - opnames.h - move enum generator into function
Branislav Zahradník [Sun, 16 Oct 2022 09:49:57 +0000 (11:49 +0200)]
Refactor opcode.pl - opnames.h - move enum generator into function

18 months agoRefactor opcode.pl - opcode.h - unglobalize output handle
Branislav Zahradník [Sun, 16 Oct 2022 09:18:04 +0000 (11:18 +0200)]
Refactor opcode.pl - opcode.h - unglobalize output handle

18 months agoRefactor opcode.pl - opcode.h - move PL_opargs into function
Branislav Zahradník [Sun, 16 Oct 2022 09:01:03 +0000 (11:01 +0200)]
Refactor opcode.pl - opcode.h - move PL_opargs into function