This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
21 months agoregex engine - improved comments explaining REGNODE_AFTER()
Yves Orton [Sun, 31 Jul 2022 11:51:36 +0000 (13:51 +0200)]
regex engine - improved comments explaining REGNODE_AFTER()

This rewrites one comment to include more explanation of the difference
between Perl_regnext() and REGNODE_AFTER().

21 months agoregex engine - integrate regnode_after() support for EXACTish nodes
Yves Orton [Sat, 30 Jul 2022 17:42:08 +0000 (19:42 +0200)]
regex engine - integrate regnode_after() support for EXACTish nodes

This adds REGNODE_AFTER_varies() which is used when the called *knows*
that the current regnode is variable length. We then use it to handle
EXACTish style nodes as determined by PL_regnode_arg_len_varies.

As part of this patch Perl_regnext() Perl_regnode_after() and
Perl_check_regnode_after() are moved to reginline.h, which is loaded via
regcomp.c only when we are compiling the regex engine.

21 months agoregex engine - rename REGNODE_AFTER_dynamic() REGNODE_AFTER()
Yves Orton [Sat, 30 Jul 2022 17:36:07 +0000 (19:36 +0200)]
regex engine - rename REGNODE_AFTER_dynamic() REGNODE_AFTER()

Now that REGNODE_AFTER() can handle all cases it makes sense
to remove the dynamic() suffix.

21 months agoregcomp.c - initial support for EXACTish nodes in regnode_after()
Yves Orton [Sat, 30 Jul 2022 17:29:43 +0000 (19:29 +0200)]
regcomp.c - initial support for EXACTish nodes in regnode_after()

This is a first step, we add the support for EXACTish nodes
here, but we do not use it. In a following commit we will move
it to a new file. This patch is just to keep the move clean.

21 months agoglobvar.sym - sort PL_reg*
Yves Orton [Sat, 30 Jul 2022 17:07:25 +0000 (19:07 +0200)]
globvar.sym - sort PL_reg*

21 months agoregex engine - Rename PL_reg_name to PL_regnode_name
Yves Orton [Sat, 30 Jul 2022 17:06:35 +0000 (19:06 +0200)]
regex engine - Rename PL_reg_name to PL_regnode_name

21 months agoregex engine - Rename PL_reg_off_by_arg to PL_regnode_off_by_arg
Yves Orton [Sat, 30 Jul 2022 17:06:34 +0000 (19:06 +0200)]
regex engine - Rename PL_reg_off_by_arg to PL_regnode_off_by_arg

21 months agoregex engine - Rename PL_regkind to PL_regnode_kind
Yves Orton [Sat, 30 Jul 2022 17:06:33 +0000 (19:06 +0200)]
regex engine - Rename PL_regkind to PL_regnode_kind

21 months agoregex engine - Rename PL_regargvaries to PL_regnode_arg_len_varies
Yves Orton [Sat, 30 Jul 2022 17:06:32 +0000 (19:06 +0200)]
regex engine - Rename PL_regargvaries to PL_regnode_arg_len_varies

21 months agoregex engine - Rename PL_regarglen to PL_regnode_arg_len
Yves Orton [Sat, 30 Jul 2022 17:06:31 +0000 (19:06 +0200)]
regex engine - Rename PL_regarglen to PL_regnode_arg_len

21 months agoregen/regcomp.pl - add PL_regargvaries
Yves Orton [Sat, 30 Jul 2022 16:55:43 +0000 (18:55 +0200)]
regen/regcomp.pl - add PL_regargvaries

21 months agoregen/regcomp.pl - add a way to dump the node/state table
Yves Orton [Sat, 30 Jul 2022 16:55:01 +0000 (18:55 +0200)]
regen/regcomp.pl - add a way to dump the node/state table

For debugging and enhancements, etc.

21 months agoregen/regcomp.pl - fix documentation (add missing PL_ prefix)
Yves Orton [Sat, 30 Jul 2022 16:54:16 +0000 (18:54 +0200)]
regen/regcomp.pl - fix documentation (add missing PL_ prefix)

21 months agoregcomp.pl - use the regnode typedefs in EXTRA_SIZE calculations
Yves Orton [Sat, 30 Jul 2022 16:51:15 +0000 (18:51 +0200)]
regcomp.pl - use the regnode typedefs in EXTRA_SIZE calculations

21 months agoregex engine - Rename reg_off_by_arg to PL_reg_off_by_arg
Yves Orton [Sat, 30 Jul 2022 16:43:01 +0000 (18:43 +0200)]
regex engine - Rename reg_off_by_arg to PL_reg_off_by_arg

This is in preparation for a future patch, so we can access
PL_reg_off_by_arg() from an inline function in regexec.c

21 months agoregex engine rename -> reg_off_by_arg
Yves Orton [Sat, 30 Jul 2022 16:35:55 +0000 (18:35 +0200)]
regex engine rename -> reg_off_by_arg

21 months agoregcomp.c - rename NEXTOPER to REGNODE_AFTER and related logic
Yves Orton [Sat, 16 Jul 2022 10:20:00 +0000 (12:20 +0200)]
regcomp.c - rename NEXTOPER to REGNODE_AFTER and related logic

It is really easy to get confused about the difference between
NEXTOPER() and regnext() of a regnode. The two concepts are related,
similar, but importantly distinct. NEXTOPER() is also defined in such a
way that it is easy to abuse and misunderstand and encourages producing
code that is fragile to larger change, effectively "baking in"
assumptions to the code that are difficult to discover by searching.
Changing the type and storage requirements of a regnode may break things
in subtle and hard to debug ways.

An example of how NEXTOPER() is problematic is that this:
NEXTOPER(NEXTOPER(branch)) does not mean "find the second node after the
branch node", it means "jump forward by a regnode which happens to be
two regnodes large". In other words NEXTOPER is just a fancy way of
writing "node+1".

This patch replaces NEXTOPER() with three new macros:

    REGNODE_AFTER_dynamic(node)
    REGNODE_AFTER_opcode(node,op)
    REGNODE_AFTER_type(node,tregnode_OPNAME)

The first is the most generic case, it jumps forward by the size of the
node, and determines that size by consulting OP(node). The second is
where you have already extracted OP(node), and the third is where you
know the actual structure that you want to jump forward by. Every
regnode type has a corresponding type, which is known at compile time,
so using the third will produce the most efficient code. However in many
cases the code operates on one of several types, whose size may be the
same now, but may change in the future, in which case one of the other
forms is preferred. The run time logic in regexec.c should probably
only use the REGNODE_AFTER_type() interface.

Note that there is also a REGNODE_BEFORE() which replaces PREVOPER(),
which is used in a specific piece of legacy logic but should not be
used otherwise. It is not safe to go backwards from an arbitrary node,
we simply have no way to know how large the previous node is and thus
where it starts.

This patch includes some logic that validates assumptions during DEBUG
mode which should catch errors from resizing regnodes.

After this patch changing the size of an existing regnode should be
relatively safe and errors related to sizing should trigger assertion
fails.

This patch includes changes to perlreguts.pod to explain this stuff
better.

21 months agoregen/regcomp.pl - create typedefs for all regnode types
Yves Orton [Sun, 3 Apr 2022 13:48:20 +0000 (15:48 +0200)]
regen/regcomp.pl - create typedefs for all regnode types

Currently we hard code the struct used by the different regop types.
This makes it awkward to change the structure used by a specific regop
as the struct it uses might be used in many contexts, and each cases
of a regop using that structure must be reviewed to see if it needs
to be changed.

This patch adds a typedef for each regnode. The typedefs are named
'tregnode_OP', for instance 'tregnode_TRIE' is typedefed to 'struct
charclass' (at the time of this commit). This allows the code to do
things like 'sizeof(tregnode_TRIE)' and should the exact struct used
for TRIE regops change in the future then no code need be reviewed
or changed.

21 months agoregen/regcomp.pl - Make regarglen available as PL_regarglen in regexec.c
Yves Orton [Mon, 18 Apr 2022 07:57:51 +0000 (09:57 +0200)]
regen/regcomp.pl - Make regarglen available as PL_regarglen in regexec.c

In a follow up patch we will use this data from regexec.c which
currently cannot see the variable.

This changes a comment in regen/mk_invlists.pl which necessitated
rebuilding several files related to unicode. Only the hashes associated
with mk_invlists.pl were changed.

21 months agoregcomp.c - replace OP(n) macro with variable 'op' in S_dumpuntil()
Yves Orton [Sat, 16 Jul 2022 10:27:48 +0000 (12:27 +0200)]
regcomp.c - replace OP(n) macro with variable 'op' in S_dumpuntil()

This declutters the code and allows us to remove the casting as well.

As a byproduct the loop control logic is a bit simplified.

21 months agoregcomp.c - replace repeated OP(n) with variable 'op'.
Yves Orton [Sat, 16 Jul 2022 10:22:29 +0000 (12:22 +0200)]
regcomp.c - replace repeated OP(n) with variable 'op'.

Declutter code.

21 months agoregen/mk_invlists.pl - under DEBUG=1 show some progress output
Yves Orton [Sat, 30 Jul 2022 14:50:45 +0000 (16:50 +0200)]
regen/mk_invlists.pl - under DEBUG=1 show some progress output

21 months agoOP_RUNCV should be created by newSVOP()
Paul "LeoNerd" Evans [Tue, 26 Jul 2022 22:03:18 +0000 (23:03 +0100)]
OP_RUNCV should be created by newSVOP()

This is in case rpeep converts it into an OP_CONST; it will need the
space big enough to be a full SVOP.

Before this commit it called `newPVOP()` which wasn't technically
correct, but since sizeof(PVOP) == sizeof(SVOP) nothing actually broke
when the memory slab was reused. However if the definition of either op
type is changed so this is no longer the case, it may cause otherwise
hard-to-debug memory corruption.

21 months agoassert() in pp_gv and pp_gvsv that the GV really is a GV
Paul "LeoNerd" Evans [Tue, 26 Jul 2022 18:20:50 +0000 (19:20 +0100)]
assert() in pp_gv and pp_gvsv that the GV really is a GV

Or, in pp_gv it's also allowed to be a reference to a CV

21 months agoCreate a dedicated cMETHOPx_meth() macro
Paul "LeoNerd" Evans [Tue, 26 Jul 2022 16:26:30 +0000 (17:26 +0100)]
Create a dedicated cMETHOPx_meth() macro

Don't just reuse the cSVOPx_sv() one any more, so we no longer have to
keep the same storage shape for SVOPs vs METHOPs.

21 months agoDefine the remaining convenience cMETHOP* macros
Paul "LeoNerd" Evans [Tue, 26 Jul 2022 16:11:23 +0000 (17:11 +0100)]
Define the remaining convenience cMETHOP* macros

Several of these were missing:
  cMETHOP, cMETHOPo, kMETHOP

Also, the field-accessing ones:
  cMETHOP_meth cMETHOP_rclass cMETHOPo_meth cMETHOPo_rclass

This commit adds them all, and use them to neaten other code where
appropriate.

21 months agoFix some unit tests to use new refcount_is() function
Paul "LeoNerd" Evans [Tue, 2 Aug 2022 15:37:30 +0000 (16:37 +0100)]
Fix some unit tests to use new refcount_is() function

21 months agoAdd a refcount_is() helper to t/test.pl
Paul "LeoNerd" Evans [Tue, 2 Aug 2022 14:49:24 +0000 (15:49 +0100)]
Add a refcount_is() helper to t/test.pl

A handy helper function that can be used in unit test .t files, rather
than currently a weird mix of using Internals::SvREFCNT everywhere.

21 months agoConfigure should avoid looping infinitely repeating the same question
Nicholas Clark [Tue, 2 Aug 2022 14:40:39 +0000 (16:40 +0200)]
Configure should avoid looping infinitely repeating the same question

Configure's helper function ./myread is intended to loop until it gets an
acceptable answer. For a couple of cases, an empty string is not acceptable
(eg 'Where is your C library?', if all automated attempts at answering this
have failed). In these cases, if Configure's standard input is /dev/null (or
closed), the shell read returns an empty string, and ./myread repeats the
question.

Before this commit, it would loop infinitely (generating continuous terminal
output). With this commit, we add a retry counter - if it asks the same
question to many times, it aborts Configure. This means that unattended
./Configure runs should now always terminate, as termination with an error
is better than spinning forever.

21 months agoperlfunc - correct argument terminology for dbmopen
Dan Book [Tue, 2 Aug 2022 04:17:32 +0000 (00:17 -0400)]
perlfunc - correct argument terminology for dbmopen

The MODE argument was renamed to MASK in 5.6, but later verbiage was added that calls it MODE again. Change the reference to MASK for consistency.

21 months agoPerl_reg_named_buff_fetch - simpler retarray creation & push
Richard Leach [Mon, 1 Aug 2022 21:33:27 +0000 (21:33 +0000)]
Perl_reg_named_buff_fetch - simpler retarray creation & push

retarray is a straightforward array created and populated with
SvIVX(sv_dat) number of elements within this function. As the
number of elements is known and all elements will be used, a
correctly-sized array can be created using newAV_alloc_x.

Since it's a straightforward array, av_push_simple can be used in
place of av_push. This will be more efficient.

21 months agoFile::Find: fix "follow => 1" on Windows
A. Sinan Unur [Thu, 28 Jul 2022 08:21:10 +0000 (10:21 +0200)]
File::Find: fix "follow => 1" on Windows

File::Find's code expects unix-style paths and it manipulates them using
basic string operations. That code is very fragile, and ideally we
should make it use File::Spec, but that would involve rewriting almost
the whole module.

Instead, we made it convert backslashes to slashes and handle drive
letters.

Note from xenu: this commit was adapted from the PR linked in this
blogpost[1]. I have squashed it, written the commit message and slightly
modified the code.

[1] - https://www.nu42.com/2021/09/canonical-paths-file-find-way-forward.html

Fixes #19995

21 months agoFile::Find: normalise indentation
Tomasz Konojacki [Thu, 28 Jul 2022 08:21:10 +0000 (10:21 +0200)]
File::Find: normalise indentation

This commit doesn't contain any functional changes. If you're
seeing it in "git blame" output, try using -w switch, it will
hide whitespace-only changes.

21 months agoFile::Find: "follow" and "follow_fast" aren't no-ops on Win32
Tomasz Konojacki [Thu, 28 Jul 2022 08:21:10 +0000 (10:21 +0200)]
File::Find: "follow" and "follow_fast" aren't no-ops on Win32

Not since 0d00729c03a1f68e1b51e986d1ce9000b0e3d301.

21 months agopod/perlsub.pod - Make three links working after pod2html conversion
Harald Jörg [Mon, 1 Aug 2022 11:03:32 +0000 (13:03 +0200)]
pod/perlsub.pod -  Make three links working after pod2html conversion

A space after the separator between text and name as in L<< text | name >>
is retained in the href element created by pod2html: href="base/ name".
Three of these occur in perlsub.pod, the links are broken in the
perlsub presentations on metacpan, perldoc.pl and github.

This patch removes a set of such spaces.

I guess this could also (or instead) be fixed in pod2html and maybe
other POD converters by making them eliminate leading spaces after
the separator?

Committer: add 2nd email address for submitter. Keep porting tests happy.

For: https://github.com/Perl/perl5/pull/20025
(superseding https://github.com/Perl/perl5/pull/20023)

21 months agofix B::walkoptree_debug()
David Mitchell [Sun, 31 Jul 2022 21:56:01 +0000 (22:56 +0100)]
fix B::walkoptree_debug()

It turns out that this method has been mostly broken since its
introduction in 1998. It will normally successfully turn debugging on
with a 'true' argument but will fail to disable again with a 'false'
argument.

This is for two reasons. First the XS code only ever sets the internal
debugging flag, never disables it, and second, it was checking the
truthfulness of the arg one too high on the stack and thus was actually
checking the CV which had just been popped off the stack, which happened
to be true.

21 months agolocale.c: Free `curlocales[j]` before overwriting
Bram [Wed, 27 Jul 2022 16:47:43 +0000 (18:47 +0200)]
locale.c: Free `curlocales[j]` before overwriting

The way to `curlocales[]` was handled in `Perl_init_i18nl10n' was a bit
fragile (in my opinion).

If one wasn't careful then it could lead to
- double free
- a (small) memory leak

With the current code there does not appear to be a way to trigger either
of those but it was to fragile for my liking.

By calling `Safefree` before overwriting the value the code becomes (imo) more
logical and the risk of the double free/memory leak disappears.

For much more details see GH #20002

21 months agolocale.c: Small cleanup of 'setlocale_failure'
Bram [Wed, 27 Jul 2022 16:18:22 +0000 (18:18 +0200)]
locale.c: Small cleanup of 'setlocale_failure'

Some context:
- `setlocale_failure` is used as a state flag to indicate if
  the `setlocale()` call succeeded;
- at the start of the function it's initialised to FALSE;
- in the loop-body the flag may get changed to TRUE if changing to
  that particular `trial_locale` failed;

Something needs to reset the flag back to 'FALSE' for the next iteration
of the loop.

The code already did this inside `if (i > 0)` block, and it was accompanied
by a misleading (and old/incorrect) comment.

Clean this up by (always) setting the value to FALSE at the start of each
iteration.

21 months agoperlguts: Fix stray > characters in POD
Dagfinn Ilmari Mannsåker [Sun, 31 Jul 2022 12:48:22 +0000 (13:48 +0100)]
perlguts: Fix stray > characters in POD

21 months agoFix typo in CvMETHOD_off definition
Leon Timmermans [Sat, 30 Jul 2022 19:49:07 +0000 (21:49 +0200)]
Fix typo in CvMETHOD_off definition

The definition uses the wrong name for the argument (off instead of cv), and
therefore causes compilation failures.

21 months agotoke.c - consistently refuse octal digit vars, and allow ${10} under strict.
Yves Orton [Wed, 27 Jul 2022 11:35:38 +0000 (13:35 +0200)]
toke.c - consistently refuse octal digit vars, and allow ${10} under strict.

Executive summary: in ${ .. } style notation consistently forbid octal
and allow multi-digit longer decimal values under strict. The vars
${1} through ${9} have always been allowed under strict, but ${10} threw
an error unlike its equivalent variable $10.

In 60267e1d0e12bb5bdc88c62a18294336ab03d4b8 I patched toke.c to refuse
octal like $001 but did not properly handle ${001} and related cases when
the code was under 'use utf8'. Part of the reason was the confusing macro
VALID_LEN_ONE_IDENT() which despite its name does not restrict what it
matches to things which are one character long.

Since the VALID_LEN_ONE_IDENT() macro is used in only one place and its
name and placement is confusing I have moved it back into the code
inline as part of this fix. I have also added more comments about what
is going on, and moved the related comment directly next to the code
that it affects. If it moved out of this code then we should think of a
better name and be more careful and clear about checking things like
length. I would argue the logic is used to parse what might be called a
variable "description", and thus it is not identical to code which might
validate an actual parsed variable name. Eg, ${^Var} is a description of
the variable whose "name" is "\026ar". The exception of course is $^
whose name actually is "^".

This includes more tests for allowed vars and forbidden var names.

See Issue #12948, Issue #19986, and Issue #19989.

22 months agoformats: fix splitting on non-spaces
David Mitchell [Fri, 29 Jul 2022 21:39:53 +0000 (22:39 +0100)]
formats: fix splitting on non-spaces

GH #19985

formats have a mode where they can repeatedly split a string to fill
within a fixed text width, splitting on (by default), spaces, newlines
and hyphens.

The splitting code was heavily rewritten by me in
v5.19.5-218-g9b4bdfd44e, but in that patch I introduced a couple of
off-by-one errors when splitting on non-white-space characters (i.e. the
hyphen by default).

It turns out that splitting on a hyphen is completely untested in core,
and further, no one noticed the problems in the wild until this ticket,
8 years later!

The first issue, and the one in the bug report, is that when splitting,
the calculation for how many spaces to pad to the end of the field was
off by one, so:

    $v1 = "AB-CDE";

    format STDOUT =
    [^<<<]~~
    $v1
    .

    write;

gives:

    [AB-  ]
    [CDE ]

but should have given:

    [AB- ]
    [CDE ]

The second issue was that it was detecting a hyphen one character
further along than the maximum field length and still splitting it there:
as above, but

    $v1 = "ABCD-E";

gives:

    [ABCD-]
    [E   ]

but should have given:

    [ABCD]
    [-E  ]

The latter was because the non-space split code was using the same logic
as the split-on-space code, which is allowed to split on a space which
is one character beyond the maximum length.

This commit fixes both issues, and adds some tests.

22 months agoregcomp.c - fixup comment, orig_emit is a node offset
Yves Orton [Mon, 18 Apr 2022 09:36:03 +0000 (11:36 +0200)]
regcomp.c - fixup comment, orig_emit is a node offset

This comment was a bit misleading, as orig_emit is an offset
into the program, not a pointer, it needs the REGNODE_p() macro
to convert from offset to pointer.

22 months agoregcomp.c - fixup whitespace in comment so table lines up
Yves Orton [Sun, 3 Apr 2022 15:12:41 +0000 (17:12 +0200)]
regcomp.c - fixup whitespace in comment so table lines up

The table got a bit out of whack, this fixes it back to what is was
meant to be.

22 months agoregcomp.c - fix comment, change 'x' to 'X'
Yves Orton [Mon, 18 Apr 2022 09:34:50 +0000 (11:34 +0200)]
regcomp.c - fix comment, change 'x' to 'X'

the rest of the surrounding comments use X not x.

22 months agoAdd an EXISTS method to NDBM_File
Leon Timmermans [Thu, 28 Jul 2022 01:54:30 +0000 (03:54 +0200)]
Add an EXISTS method to NDBM_File

22 months agoFix GH #20009, pattern match panic
Karl Williamson [Thu, 28 Jul 2022 19:45:02 +0000 (13:45 -0600)]
Fix GH #20009, pattern match panic

This was the result of using the wrong case in a switch()

Thanks to @bram-perl for the idea of the test case reduction

22 months agoperldelta entry for OP_ENTERSUB OPf_SPECIAL flag changes
Dagfinn Ilmari Mannsåker [Wed, 27 Jul 2022 19:06:38 +0000 (20:06 +0100)]
perldelta entry for OP_ENTERSUB OPf_SPECIAL flag changes

22 months agoDon't set OPf_SPECIAL on implicit attributes->import call
Dagfinn Ilmari Mannsåker [Wed, 27 Jul 2022 17:55:54 +0000 (18:55 +0100)]
Don't set OPf_SPECIAL on implicit attributes->import call

This flag does not appear to have ever been used for anything.

22 months agoDon't set OPf_SPECIAL on ENTERSUB for lvalue sub assignments
Dagfinn Ilmari Mannsåker [Wed, 27 Jul 2022 17:41:32 +0000 (18:41 +0100)]
Don't set OPf_SPECIAL on ENTERSUB for lvalue sub assignments

This flag does not appear ever have been used for anything in this context.

22 months agoDon't set the OPf_SPECIAL bit on implicit VERSION/import/export calls
Dagfinn Ilmari Mannsåker [Wed, 27 Jul 2022 17:39:59 +0000 (18:39 +0100)]
Don't set the OPf_SPECIAL bit on implicit VERSION/import/export calls

The implicit method calls use by `use` and `no` were setting the
OPf_SPECIAL bit on the ENTERSUB op, but that has never made any
difference to anything.

22 months agoB::Deparse: Remove obsolete handling of OP_ENTERSUB's OPf_SPECIAL flag
Dagfinn Ilmari Mannsåker [Wed, 27 Jul 2022 17:03:46 +0000 (18:03 +0100)]
B::Deparse: Remove obsolete handling of OP_ENTERSUB's OPf_SPECIAL flag

It was used to flag that call sub was being called using the `do
SUBNAME(LIST)` notation, which was removed in 5.20 (commit
8c74b41425572faeb638f1269025b59d0785794f).

22 months agoAPItest:locale.t: Use proper test for LC_ALL presence
Karl Williamson [Tue, 26 Jul 2022 21:48:28 +0000 (15:48 -0600)]
APItest:locale.t: Use proper test for LC_ALL presence

If no LC_ALL, there won't be an LC_ALL() sub.  Instead use the string
'LC_ALL" and an explicit check to see if it is there.

22 months agocharset.t: Requires LC_ALL, LC_CTYPE to run
Karl Williamson [Tue, 26 Jul 2022 21:47:18 +0000 (15:47 -0600)]
charset.t: Requires LC_ALL, LC_CTYPE to run

22 months agoregex_sets.t: Requires LC_ALL to run
Karl Williamson [Tue, 26 Jul 2022 21:46:26 +0000 (15:46 -0600)]
regex_sets.t: Requires LC_ALL to run

22 months agoBump B.pm version after recent commit
David Mitchell [Tue, 26 Jul 2022 11:34:54 +0000 (12:34 +0100)]
Bump B.pm version after recent commit

22 months agoMakefile.SH: remove prerequisites on suffix rules
David Mitchell [Tue, 26 Jul 2022 11:02:43 +0000 (12:02 +0100)]
Makefile.SH: remove prerequisites on suffix rules

Since GNU make 3.4, the build process has been emitting about 24 of
these warnings:

    Makefile:254: warning: ignoring prerequisites on suffix rule definition
    Makefile:258: warning: ignoring prerequisites on suffix rule definition

This is because Makefile has a couple of entries like these:

.c.i:  perl.h config.h
        ...

.c.s:  perl.h config.h
        ...

These are suffix rules, which generically tell 'make' how to make a foo.i
or foo.s file from a foo.c file.

The warnings are telling us that prerequisites (perl.h config.h in this
case) are not appropriate for suffix rules and are being ignored
(they've always been ignored, just silently prior to 3.4).

Those suffix rules were added by me with commit v5.19.7-38-gba0f550339,
but the prerequisites were later added by Jarkko with
v5.21.3-467-g29b9baacc9:

    The .i target should depend at least on perl.h and config.h.
    While at it, do the same for the .s target.

I can't see any discussion of this commit, so I'm not sure what issue it
was trying to fix. But since the prerequisites were being silently
ignored (on GNU make anyway), it seems safe to remove them, which is
what this commit does. With the prerequisites gone, doing

    $ touch config.sh
    $ make peep.i

causes 'make' to process a whole big chain of dependencies, so it would
appear that the correct dependency chain is being detected regardless.

For reference, here's the entry from the GNU 'make' manual:

    warning: ignoring prerequisites on suffix rule definition

    According to POSIX, a suffix rule cannot contain prerequisites. If a
    rule that could be a suffix rule has prerequisites it is interpreted
    as a simple explicit rule, with an odd target name. This requirement
    is obeyed when POSIX-conforming mode is enabled (the .POSIX target
    is defined). In versions of GNU make prior to 4.3, no warning was
    emitted and a suffix rule was created, however all prerequisites
    were ignored and were not part of the suffix rule. Starting with GNU
    make 4.3 the behavior is the same, and in addition this warning is
    generated. In a future version the POSIX-conforming behavior will be
    the only behavior: no rule with a prerequisite can be suffix rule
    and this warning will be removed.

22 months agoAdd perldelta for CVf_METHOD rename
Paul "LeoNerd" Evans [Mon, 11 Jul 2022 09:08:57 +0000 (10:08 +0100)]
Add perldelta for CVf_METHOD rename

22 months agoAdd back-compatibility aliases for renamed CVf_METHOD flag
Paul "LeoNerd" Evans [Sat, 9 Jul 2022 12:16:37 +0000 (13:16 +0100)]
Add back-compatibility aliases for renamed CVf_METHOD flag

22 months agoRename CVf_METHOD to CVf_NOWARN_AMBIGUOUS
Paul "LeoNerd" Evans [Sat, 9 Jul 2022 11:22:48 +0000 (12:22 +0100)]
Rename CVf_METHOD to CVf_NOWARN_AMBIGUOUS

Also renames the CvMETHOD* macro family to CvNOWARN_AMBIGUOUS*

22 months agoUnixish.h, doshish.h: Reorder terminations; simplify
Karl Williamson [Tue, 9 Feb 2021 19:48:18 +0000 (12:48 -0700)]
Unixish.h, doshish.h: Reorder terminations; simplify

The IO and memory terminations need to be after other things.  Add a
comment so that future maintainers won't make the mistakes I did.

Also refactor so that amiga os doesn't have a separate list to get out
of sync

I suspect that the amiga termination should be moved to earlier in
the sequence, but absent any evidence; I'm leaving it unchanged.

vms destruction was missing a bunch of things and I didn't see any
reason to have special handling, so I changed it to just use the
standard, presuming the discrepancies were due to changes in the
standard not getting propagated to vms.

The common definitions are also moved to perl.c which is the only place
they are used (including cpan).  This makes them available in all
circumstances.  Otherwise, the #ifdef's for including the relevant
header files only include one, so there would be undefined macros.

22 months agoAdd whitespace in 'Setting locale failed' error
Bram [Mon, 25 Jul 2022 16:53:22 +0000 (18:53 +0200)]
Add whitespace in 'Setting locale failed' error

When LC_ALL doesn't exist(*) then the error message printed wasn't readable.

Before:
    $ LC_ALL= LC_NUMERIC='aa_BB' LC_PAPER='cc_DD'  ./perl -e1
    perl: warning: Setting locale failed for the categories:
        LC_NUMERICLC_PAPERperl: warning: Please check that your locale settings:
        LANGUAGE = "en_US:en",
        ...

After:
    $ LC_ALL= LC_NUMERIC='aa_BB' LC_PAPER='cc_DD'  ./perl -e1
    perl: warning: Setting locale failed for the categories:
        LC_NUMERIC
        LC_PAPER
    perl: warning: Please check that your locale settings:
        ...

(The output got mangled in commit e5f10d4955)

(*) I faked this by adding '#undef LC_ALL' inside locale.c. This does
    cause some test failure since some tests assume 'LC_ALL' is present.

22 months agoPathTools/t/cwd_enoent.t: a fixup to version check
David Mitchell [Mon, 25 Jul 2022 08:52:40 +0000 (09:52 +0100)]
PathTools/t/cwd_enoent.t: a fixup to version check

v5.37.1-202-g0d6ab5e425 just added a version check for dragonfly;
however, it generates sprintf warnings unless the OS's version has
exactly two numeric components.

The fix is trivial.

22 months agolib/locale.t: White space only
Karl Williamson [Sun, 17 Jul 2022 20:42:08 +0000 (14:42 -0600)]
lib/locale.t: White space only

Indent, as the previous commit added an enclosing block

22 months agolib/locale.t: Skip LC_TIME test if no LC_TIME
Karl Williamson [Sun, 17 Jul 2022 20:39:33 +0000 (14:39 -0600)]
lib/locale.t: Skip LC_TIME test if no LC_TIME

22 months agolib/warnings.t: regexec warnings need LC_CTYPE
Karl Williamson [Sun, 17 Jul 2022 20:38:26 +0000 (14:38 -0600)]
lib/warnings.t: regexec warnings need LC_CTYPE

Otherwise they don't operate.

22 months agot/uni/overload.t: Skip if LC_CTYPE not avail
Karl Williamson [Sun, 17 Jul 2022 20:36:05 +0000 (14:36 -0600)]
t/uni/overload.t: Skip if LC_CTYPE not avail

It turns out these tests need LC_CTYPE which may not exist, so LC_ALL
isn't sufficient

22 months agoAdd 5.037003 to CoreList
Nicolas R [Thu, 21 Jul 2022 04:14:45 +0000 (04:14 +0000)]
Add 5.037003 to CoreList

22 months agoBump version to 5.37.3
Nicolas R [Thu, 21 Jul 2022 04:06:16 +0000 (04:06 +0000)]
Bump version to 5.37.3

22 months agoUpdate epigraphs.pod for 5.37.2
Nicolas R [Thu, 21 Jul 2022 04:13:41 +0000 (04:13 +0000)]
Update epigraphs.pod for 5.37.2

22 months agoNew perldelta setup for 5.37.3
Nicolas R [Thu, 21 Jul 2022 03:58:31 +0000 (03:58 +0000)]
New perldelta setup for 5.37.3

22 months agoTick 5.37.2 ✓ on 2022-07-20
Nicolas R [Thu, 21 Jul 2022 03:54:25 +0000 (03:54 +0000)]
Tick 5.37.2 ✓ on 2022-07-20

22 months agoperlhist: update release date for 5.37.2 v5.37.2
Nicolas R [Wed, 20 Jul 2022 23:06:45 +0000 (23:06 +0000)]
perlhist: update release date for 5.37.2

22 months agoUpdate perldelta for 5.37.2
Nicolas R [Wed, 20 Jul 2022 22:24:51 +0000 (22:24 +0000)]
Update perldelta for 5.37.2

22 months agoUpdate Module::CoreList for 5.37.2
Nicolas R [Wed, 20 Jul 2022 22:51:50 +0000 (22:51 +0000)]
Update Module::CoreList for 5.37.2

22 months agoSync Test::Simple with CPAN 1.302191
Nicolas R [Wed, 20 Jul 2022 19:47:30 +0000 (19:47 +0000)]
Sync Test::Simple with CPAN 1.302191

From ChangeLog:

- avoid failing when printing diagnostic info comparing
partial overload objects

22 months agoSync Text::Balanced with CPAN 2.06
Nicolas R [Wed, 20 Jul 2022 19:53:28 +0000 (19:53 +0000)]
Sync Text::Balanced with CPAN 2.06

Remove legacy exclude rules from Porting/Maintainers.pl

22 months agoSync PerlIO::via::QuotedPrint with CPAN 0.10
Nicolas R [Wed, 20 Jul 2022 19:40:26 +0000 (19:40 +0000)]
Sync PerlIO::via::QuotedPrint with CPAN 0.10

Add missing exit() to t/QuotedPrint.t

22 months agopp_subst: optimize by not calling utf8_length
Loren Merritt [Thu, 14 Jul 2022 00:09:06 +0000 (00:09 +0000)]
pp_subst: optimize by not calling utf8_length

Length just isn't needed, and often took more cpu-time than the actual regex.

22 months agoAdd some links to vote_admin_guide.pod
Nicolas R [Mon, 27 Jun 2022 14:44:46 +0000 (08:44 -0600)]
Add some links to vote_admin_guide.pod

22 months agorelease 6.2 of Dragonfly BSD fixed getcwd()
Tony Cook [Wed, 13 Jul 2022 05:06:17 +0000 (15:06 +1000)]
release 6.2 of Dragonfly BSD fixed getcwd()

See:

https://www.dragonflybsd.org/releases/changelog/62/

which lists ticket 3250.

22 months agoproperly populate osvers on Dragonfly BSD when the hostname isn't set
Tony Cook [Wed, 13 Jul 2022 05:01:04 +0000 (15:01 +1000)]
properly populate osvers on Dragonfly BSD when the hostname isn't set

A default installation of DragonflyBSD doesn't necessarily set the
hostname, resulting in a `uname -a` like:

  DragonFly  6.2-RELEASE DragonFly v6.2.2-RELEASE ...

which resulted in osvers being set to "dragonfly", which isn't
especially useful.

So check that $3 is numeric in some sense before using it, falling
back to $2 if it isn't.  This should only happen when the hostname
isn't set.

22 months agoConfigure: Add missing `#include <inttypes.h>` to test programs
TAKAI Kousuke [Sat, 16 Jul 2022 08:29:05 +0000 (17:29 +0900)]
Configure: Add missing `#include <inttypes.h>` to test programs

With -Duse64bitint on 32-bit machines, UV might be configured
to `uint64_t`.  But some Configure tests used $uvtype without including
<inttypes.h>, which may cause compilation error of those tests on
sucn configurations, and eventually make perl not built correctly.

22 months agoConfigure: Fix typos for C99 macro name PRIX64
TAKAI Kousuke [Sat, 16 Jul 2022 00:35:55 +0000 (09:35 +0900)]
Configure: Fix typos for C99 macro name PRIX64

There are no macros named PRIXU64.  This line seems to date back to
commit 6b356c8efb963846940ef92952cf77e5b86bd65e which renamed shell
variable names to work well with case-insensitive systems,
but could have overdone a bit.

22 months agoDescription spelling should match function spelling
James E Keenan [Wed, 20 Jul 2022 13:51:36 +0000 (13:51 +0000)]
Description spelling should match function spelling

22 months agoTests for prototypes of 'builtin::*' functions
James E Keenan [Wed, 20 Jul 2022 13:49:07 +0000 (13:49 +0000)]
Tests for prototypes of 'builtin::*' functions

22 months agoSync experimental with CPAN 0.028
Nicolas R [Wed, 20 Jul 2022 17:14:21 +0000 (17:14 +0000)]
Sync experimental with CPAN 0.028

Add extra_paired_delims feature

Note: skip cmp_version for lib/experimental.pm
in 0.028 as version was bumped prior CPAN release.

22 months agoSync Math::BigRat with CPAN 0.2624
Nicolas R [Wed, 20 Jul 2022 19:27:46 +0000 (19:27 +0000)]
Sync Math::BigRat with CPAN 0.2624

From ChangeLog:

0.2624 2022-06-27

 * Improve stringification. Better handling of upgrading/downgrading in
   stringification methods. Add new method bfstr() for compatibility
with
   Math::BigInt og Math::BigFloat. Add new author test files to confirm.

0.2623 2022-05-16

 * Fix rounding issues.

0.2622 2022-04-13

 * Add more cases for downgrading, and more tests.

22 months agoSync Math::BigInt::FastCalc with CPAN 0.5013
Nicolas R [Wed, 20 Jul 2022 19:25:41 +0000 (19:25 +0000)]
Sync Math::BigInt::FastCalc with CPAN 0.5013

Sync test files with Math-BigInt

22 months agoSync Math::BigInt with CPAN 1.999837
Nicolas R [Wed, 20 Jul 2022 19:22:52 +0000 (19:22 +0000)]
Sync Math::BigInt with CPAN 1.999837

From ChangeLog:

1.999837 2022-07-02

 * Improve the interoperability between objects of different classes for
 * the
   methods that are still used as functions.

1.999836 2022-06-24

 * Improve compatibility with older versions of the Math-BigRat
 * distribution.
   Math-BigInt version 1.999835 works with Math-BigRat version 0.2623
and newer.
   Math-BigInt version 1.999836 works with Math-BigRat version 0.2618
and newer.

 * Re-enable upgrading in Math::BigFloat->bdiv().

 * Fix an error in the enabling/disabling of upgrading/downgrading.

 * Fix typos and other formatting errors.

1.999835 2022-05-24

 * Fix bug related to upgrading in Math::BigInt->brsft(). This bug
   only showed up in Perl versions 5.16 and older.

1.999834 2022-05-23

 * Further improvements to upgrading and downgrading.

1.999833 2022-05-23

 * Fix Math::BigFloat->bpi(). The previous attempt at correcting it
   wasn't sufficient. Added test to verify the fix.

 * Correct the formatting in the CHANGES file.

1.999832 2022-05-21

 * Improve as_int(), as_float(), and as_rat() so that they return a
   Math::BigInt, Math::BigFloat, and Math::BigRat, respectivly,
   regardless of upgrading and downgrading.

 * Improve stringification method bsstr() so that it handles upgrading
   and downgrading better.

 * Fix Math::BigFloat->bpi(), which unfortunately didn't handle
   downgrading.

 * Avoid unnecessary downgrading/upgrading.

 * Add missed cases where downgrading/upgrading should be performed.

 * Avoid unnecessary stringification.

1.999831 2022-05-16

 * Further improvements to upgrading, downgrading, and rounding.

 * New stringification method bfstr() for representing numbers as
 * fractions.
   E.g., Math::BigFloat -> new("1.25") -> bfstr() returns "5/4".

 * Miscellaneous bug fixes.

 * Fixed errors and typos in the documentation.

22 months agoPod::Usage with CPAN 2.03
Nicolas R [Wed, 20 Jul 2022 19:17:02 +0000 (19:17 +0000)]
Pod::Usage with CPAN 2.03

22 months agoSync Pod::Checker with CPAN 1.75
Nicolas R [Wed, 20 Jul 2022 19:14:53 +0000 (19:14 +0000)]
Sync Pod::Checker with CPAN 1.75

integrate patch from RT#142524

22 months agoUpdate libnet to CPAN 3.14
Nicolas R [Wed, 20 Jul 2022 19:05:50 +0000 (19:05 +0000)]
Update libnet to CPAN 3.14

22 months agoUpdate Filter::Util::Call to CPAN 1.61
Nicolas R [Wed, 20 Jul 2022 17:23:58 +0000 (17:23 +0000)]
Update Filter::Util::Call to CPAN 1.61

Preserve customized pod/perlfilter.pod

22 months agoFix typo in perlunicode
Karl Williamson [Wed, 20 Jul 2022 20:04:49 +0000 (14:04 -0600)]
Fix typo in perlunicode

22 months agoAdd Haarg to the Core Team
Nicolas R [Wed, 20 Jul 2022 15:56:32 +0000 (09:56 -0600)]
Add Haarg to the Core Team

After a one week election, haarg is now elected
as a new member of the Perl Core Team.

URL: https://civs1.civs.us/cgi-bin/results.pl?id=E_452873954bf5383a

22 months agoBump Win32 tarball
Nicolas R [Wed, 20 Jul 2022 19:58:02 +0000 (19:58 +0000)]
Bump Win32 tarball

Win32 was bumped to version 0.59
but Porting/Maintainers.pl was still
pointing at 0.58.

Refs: 042c826b661ee2bcfe869118a756b72aec2c82bd

22 months agoBump Locale::Maketext tarball
Nicolas R [Wed, 20 Jul 2022 19:10:20 +0000 (19:10 +0000)]
Bump Locale::Maketext tarball

This was bumped and released to CPAN
but the tarball was still pointing at 1.29.

Refs: f5469426bb7bc14a72843f9855d2494b01f8df0f

22 months agoUpdate IO::Compress to CPAN 2.201
Nicolas R [Wed, 20 Jul 2022 17:34:18 +0000 (17:34 +0000)]
Update IO::Compress to CPAN 2.201

From ChangeLog

  2.201 25 June 2022

      * Disable zib header tests
        Sat Jun 25 09:10:59 2022 +0100
        63eb5d37291b40dbf07d191a09b7876168008cd4

      * Version 2.201
        Sat Jun 25 09:00:42 2022 +0100
        af51310f68bb225d94eaa29b7f3d2bece1935dfd

      * doc update https://github.com/pmqs/IO-Compress/issues/38
        Thu Jun 23 23:00:31 2022 +0100
        2002d4fd3b3a6f5de6c6c3dc5989cf42581c1758

      * Changes for zlib-ng
        Thu Jun 23 22:43:50 2022 +0100
        2bd52d2918823cc567c3e92dd3d15f87cb4ee8f8

      * Add perl 5.36
        Sun Jun 5 13:34:18 2022 +0100
        ede55370ed4c7eb3c66abc71bc25c7e4019b4c44

      * force streaming zip file when writing to stdout
      * https://github.com/pmqs/IO-Compress/issues/42
        Sun Apr 24 19:43:19 2022 +0100
        b57a3f83f404f5a24242680de5b406cfcf5c03ac

      * read zip timestamp in localtime
        Sun Apr 24 13:11:58 2022 +0100
        0c838f43dc46f292714c82145c9add9932196b01

      * streamzip: tighten up version tests for failing windows tests
      * https://github.com/pmqs/IO-Compress/issues/41
        Sun Apr 24 12:49:57 2022 +0100
        3497645228235ea12c4d559d6dedd4cef47fc94a

      * streamzip: update year
        Sun Apr 24 12:11:35 2022 +0100
        0ac0d1ef603d8854ffc35976196735b663764992

      * Use Time::Local instead of  POSIX::mktime
        Tue Apr 19 11:31:43 2022 +0100
        64a106f1119cbc7dec8db52dca016bb8baacf2d4

22 months agoSync Compress-Raw-Zlib with CPAN 2.202
Nicolas R [Wed, 20 Jul 2022 16:57:38 +0000 (16:57 +0000)]
Sync Compress-Raw-Zlib with CPAN 2.202

From ChangeLog:

  2.202 27 June 2022

      * Z_NULL should be 'UV' rather than 'PV'
        https://github.com/pmqs/Compress-Raw-Zlib/issues/17
        Sun Jun 26 22:02:04 2022 +0100
        de28f0335d3d605d696b19d43fc48de42272455c

  2.201 25 June 2022

      * 2.021
        Sat Jun 25 08:42:46 2022 +0100
        85416cab509c18c5fa3f923de7b45b6c7c0f7a6f

      * 2.201
        Sat Jun 25 08:39:26 2022 +0100
        b3d63862b2ff4ac9d28e23be500c0d32ad69dd11

      * More zlib-ng updates
        Thu Jun 23 22:42:13 2022 +0100
        313f626425181702b5fc80af2b6ea7eed41d5a9d

      * Fix test count regression in t/07bufsize.t (#16)
        Wed Jun 22 09:45:11 2022 +0100
        98dc5b4a2b30c26752b6f686462b06b8db72a5e4

  2.200 21 June 2022

      * Added zlib-ng support
        https://github.com/pmqs/Compress-Raw-Zlib/issues/9

      * Only set Z_SOLO when building zlib sources
      * https://github.com/pmqs/Compress-Raw-Zlib/issues/12
        Tue Jun 7 10:13:00 2022 +0100
        c44e0b732e214b7f77d42a3af6ae64ef944cee90

  2.105 14 April 2022

      * Add Compress::Raw::Zlib::VERSION to output
        Sat May 14 15:16:57 2022 +0100
        3e22c93169a67986017f64d9a2e5085c417d8624

      * Dump version info when running test harness
        Sat May 14 15:10:17 2022 +0100
        ca9f33ba0323d0abc91a83800636f180b2b44162

      * Fix use of ZLIB_INCLUDE/LIB
        Sat May 14 09:01:38 2022 +0100
        8a7d4a97d7441b61a8a888342766419044fa5a33

      * More fixes for BUILD_ZLIB off
        Sat May 14 08:54:04 2022 +0100
        2d9650094dab90858ef58bfbda62f3bc60e159e4

      * Add BUILD_ZLIB to the matrix
        Sat May 14 08:31:54 2022 +0100
        b61b92fc9d06bf04f1adec337357ffbd39535901

      * Merge branch 'master' of
      * https://github.com/pmqs/Compress-Raw-Zlib
        Sat May 14 08:27:14 2022 +0100
        3ac7d0d3d45ae263402fab1ebb3835e2ae16c5a6

      * Fix for BUILD_ZLIB disabled
        Sat May 14 08:25:34 2022 +0100
        b0f04e37fb58a34ef01767ad16a8f63ca868eec6

      * Add BUILD_ZLIB to the matrix
        Sat May 14 08:22:56 2022 +0100
        aa8f5ff981c7305c995d4e2f798ae0d7d45866a5

  2.104 13 April 2022

      * Merge pull request #11 from monkburger/symbol_fix_2
        Fri May 13 07:17:19 2022 +0100
        64aea2d3f78946d7df4096eadfa0d7267f4439a5

      * perl_crz -> Perl_crz
        Tue May 3 18:19:24 2022 +0000
        20502e6c2eba8ddcad80b20574e840457c0cb369

      * This is a slightly different way to fix
      * https://github.com/pmqs/Compress-Raw-Zlib/issues/8
        Tue May 3 18:06:48 2022 +0000
        d9cd27fb212da7455b6ba44729ca11bb441f3950

      * add tests for crc32/adler32_combine
        Mon May 2 16:18:13 2022 +0100
        dcfe9ef439790f1a4fae81cf3eac38cfeb848294