Skip to content

Commit 6a4f62c

Browse files
committed
t/porting/diag.t: fix oversights in message extraction regex
- recognize the short form() as well as Perl_form() - accept/ignore spaces between `Perl_croak(` and `aTHX_` With this change, diag.t now recognizes several diagnostic messages that went undetected previously (note the space before `aTHX_`): - perlio.c Perl_croak( aTHX_ "%s (%" UVuf ") does not match %s (%" UVuf ")", Perl_croak( aTHX_ "%s (%" UVuf ") smaller than %s (%" UVuf ")", - regcomp_trie.c Perl_croak( aTHX_ "error creating/fetching widecharmap entry for 0x%" UVXf, uvc ); default: Perl_croak( aTHX_ "panic! In trie construction, unknown node type %u %s", (unsigned) flags, REGNODE_NAME(flags) ); Perl_croak( aTHX_ "panic! In trie construction, no char mapping for %" IVdf, uvc ); This PR partially overlaps with #23017. Merging either will cause conflicts in the other that will have to be resolved manually. (In particular, if this PR is merged first, the diag.t changes from #23017 can be dropped, as can some of the perldiag.pod additions. But that PR also modifies the perlio.c messages, so their old forms added here ("%s (%d) does not match %s (%d)", "%s (%d) smaller than %s (%d)") will have to be deleted.)
1 parent 71d1d45 commit 6a4f62c

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

pod/perldiag.pod

+22
Original file line numberDiff line numberDiff line change
@@ -2283,6 +2283,11 @@ L<builtin> by using the C<unimport> method (likely via C<no builtin ...>
22832283
syntax), but the requested function has not been imported into the current
22842284
scope.
22852285

2286+
=item %s (%d) does not match %s (%d)
2287+
2288+
(P) The size of a PerlIO function table passed by an extension is smaller than
2289+
expected.
2290+
22862291
=item Don't know how to get file name
22872292

22882293
(P) C<PerlIO_getname>, a perl internal I/O function specific to VMS, was
@@ -2403,6 +2408,10 @@ single form when it must operate on them directly. Either you've passed
24032408
an invalid file specification to Perl, or you've found a case the
24042409
conversion routines don't handle. Drat.
24052410

2411+
=item error creating/fetching widecharmap entry for 0x%X
2412+
2413+
(P) A failure happened when folding a character for a regex trie.
2414+
24062415
=item Error %s in expansion of %s
24072416

24082417
(F) An error was encountered in handling a user-defined property
@@ -5092,6 +5101,14 @@ the glob and a destructor that adds a new object to the glob.
50925101

50935102
(P) The lexer got into a bad state parsing a string with brackets.
50945103

5104+
=item panic! In trie construction, no char mapping for %d
5105+
5106+
(P) A failure happened in the construction of a regex trie.
5107+
5108+
=item panic! In trie construction, unknown node type %u %s
5109+
5110+
(P) An unexpected node type was encountered in regex trie construction.
5111+
50955112
=item panic: kid popen errno read
50965113

50975114
(F) A forked child returned an incomprehensible message about its errno.
@@ -6227,6 +6244,11 @@ requested.
62276244
hash) parameter. The slurpy parameter takes all the available arguments,
62286245
so there can't be any left to fill later parameters.
62296246

6247+
=item %s (%d) smaller than %s (%d)
6248+
6249+
(P) The size of a PerlIO instance passed by an extension is smaller than
6250+
expected.
6251+
62306252
=item Smart matching a non-overloaded object breaks encapsulation
62316253

62326254
(F) You should not use the C<~~> operator on an object that does not

t/porting/diag.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ my $source_msg_re =
6464
"(?<routine>\\bDIE\\b|$function_re)";
6565
my $text_re = '"(?<text>(?:\\\\"|[^"]|"\s*[A-Z_]+\s*")*)"';
6666
my $source_msg_call_re = qr/$source_msg_re(?:_nocontext)? \s*
67-
\( (?: \s* Perl_form \( )? (?:aTHX_)? \s*
67+
\( (?: \s* (?: Perl_ )? form \( )? (?: \s* aTHX_)? \s*
6868
(?:packWARN\d*\((?<category>.*?)\),)? \s*
6969
(?:(?<category>WARN_DEPRECATED__\w+)\s*,(?:\s*(?<version_string>"[^"]+")\s*,)?)? \s*
7070
$text_re /x;

0 commit comments

Comments
 (0)