summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-11-17 13:09:26 -0800
committerFather Chrysostomos <sprout@cpan.org>2013-11-17 13:09:26 -0800
commitc9ca859379e0038cd8bb6170fee4b33f9e314e70 (patch)
tree5125f63e698977fc6e046e0cf7ffeebb6ade6c69
parent768cd72cbf4d0c838eb1ede6f02a6276be08a934 (diff)
parente0e4a6e35e27d5da9d86f32936fdc00aa1f92443 (diff)
downloadperl-c9ca859379e0038cd8bb6170fee4b33f9e314e70.tar.gz
[Merge] perldiag stuff
I noticed that some entries in perldiag had (F ...) with warnings categories. Those categories apply only to warnings, not to fatal errors. So I looked to see why diag.t was not already catching it, since I thought I had programmed it to. It turned out that it was skipping any function calls that lacked aTHX_, which included yyerror and anything with _nocontext. So I fixed that and got pages and pages of failures, unsurprisingly. I went through, fixing them, and inevitably tweaking other things. In one case, I even changed the message output, removing an extraneous dot before ‘at file line 24’.
-rw-r--r--op.c2
-rw-r--r--pod/perldiag.pod349
-rw-r--r--regcomp.c7
-rw-r--r--t/lib/croak/toke6
-rw-r--r--t/porting/diag.t117
-rw-r--r--toke.c6
-rw-r--r--universal.c3
7 files changed, 336 insertions, 154 deletions
diff --git a/op.c b/op.c
index 3355a65e20..236a6e0aa4 100644
--- a/op.c
+++ b/op.c
@@ -2979,8 +2979,10 @@ Perl_bind_match(pTHX_ I32 type, OP *left, OP *right)
/* !~ doesn't make sense with /r, so error on it for now */
if (rtype == OP_SUBST && (cPMOPx(right)->op_pmflags & PMf_NONDESTRUCT) &&
type == OP_NOT)
+ /* diag_listed_as: Using !~ with %s doesn't make sense */
yyerror("Using !~ with s///r doesn't make sense");
if (rtype == OP_TRANSR && type == OP_NOT)
+ /* diag_listed_as: Using !~ with %s doesn't make sense */
yyerror("Using !~ with tr///r doesn't make sense");
ismatchop = (rtype == OP_MATCH ||
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index bdd3f826db..bdf8c5509b 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -210,7 +210,7 @@ See L<charnames/CUSTOM ALIASES>.
(X) The malloc package that comes with Perl had an internal failure.
-=item Assertion failed: file "%s"
+=item Assertion %s failed: file "%s", line %d
(X) A general assertion failed. The file in question must be examined.
@@ -489,7 +489,7 @@ occurred. Since the intended environment for the C<BEGIN {}> could not
be guaranteed (due to the errors), and since subsequent code likely
depends on its correct operation, Perl just gave up.
-=item \1 better written as $1
+=item \%d better written as $%d
(W syntax) Outside of patterns, backreferences live on as variables.
The use of backslashes is grandfathered on the right-hand side of a
@@ -513,9 +513,11 @@ check the return value of your socket() call? See L<perlfunc/bind>.
(W unopened) You tried binmode() on a filehandle that was never opened.
Check your control flow and number of arguments.
-=item "\b{" is deprecated; use "\b\{" or "\b[{]" instead in regex; marked by <-- HERE in m/%s/
+=item "\b{" is deprecated; use "\b\{" or "\b[{]" instead in regex; marked
+by S<<-- HERE> in m/%s/
-=item "\B{" is deprecated; use "\B\{" or "\B[{]" instead in regex; marked by <-- HERE in m/%s/
+=item "\B{" is deprecated; use "\B\{" or "\B[{]" instead in regex; marked
+by S<<-- HERE> in m/%s/
(D deprecated) Use of an unescaped "{" immediately following
a C<\b> or C<\B> is now deprecated so as to reserve its use for Perl
@@ -1617,8 +1619,8 @@ a good way to enquire about the features of a package, or whether
it's loaded, etc.
-=item (?(DEFINE)....) does not allow branches in regex; marked by <-- HERE in
-m/%s/
+=item (?(DEFINE)....) does not allow branches in regex; marked by
+S<<-- HERE> in m/%s/
(F) You used something like C<(?(DEFINE)...|..)> which is illegal. The
most likely cause of this error is that you left out a parenthesis inside
@@ -1736,6 +1738,11 @@ define a C<$VERSION>.
(F) You cannot put a repeat count of any kind right after the '/' code.
See L<perlfunc/pack>.
+=item Don't know how to get file name
+
+(P) C<PerlIO_getname>, a perl internal I/O function specific to VMS, was
+somehow called on another platform. This should not happen.
+
=item Don't know how to handle magic of type \%o
(P) The internal handling of magical variables has been cursed.
@@ -1781,7 +1788,7 @@ it's ugly. Your code will be interpreted as an attempt to call a method
named "elseif" for the class returned by the following block. This is
unlikely to be what you want.
-=item Empty \%c{} in regex; marked by <-- HERE in m/%s/
+=item Empty \%c{} in regex; marked by S<<-- HERE> in m/%s/
(F) C<\p> and C<\P> are used to introduce a named Unicode property, as
described in L<perlunicode> and L<perlre>. You used C<\p> or C<\P> in
@@ -1845,8 +1852,8 @@ L<perlre/(?{ code })>.
assertion, but that construct is only allowed when the C<use re 'eval'>
pragma is in effect. See L<perlre/(?{ code })>.
-=item EVAL without pos change exceeded limit in regex; marked by <-- HERE in
-m/%s/
+=item EVAL without pos change exceeded limit in regex; marked by
+S<<-- HERE> in m/%s/
(F) You used a pattern that nested too many EVAL calls without consuming
any text. Restructure the pattern so that text is consumed.
@@ -1910,7 +1917,7 @@ as a goto, or a loop control statement.
(W exiting) You are exiting a substitution by unconventional means, such
as a return, a goto, or a loop control statement.
-=item Expecting close bracket in regex; marked by <-- HERE in m/%s/
+=item Expecting close bracket in regex; marked by S<<-- HERE> in m/%s/
(F) You wrote something like
@@ -1920,7 +1927,7 @@ to denote a capturing group of the form
L<C<(?I<PARNO>)>|perlre/(?PARNO) (?-PARNO) (?+PARNO) (?R) (?0)>,
but omitted the C<")">.
-=item Expecting '(?flags:(?[...' in regex; marked by <-- HERE in m/%s/
+=item Expecting '(?flags:(?[...' in regex; marked by S<<-- HERE> in m/%s/
(F) The C<(?[...])> extended character class regular expression construct
only allows character classes (including character class escapes like
@@ -1957,13 +1964,13 @@ Check the #! line, or manually feed your script into Perl yourself.
CHECK, INIT, or END subroutine. Processing of the remainder of the
queue of such routines has been prematurely ended.
-=item False [] range "%s" in regex; marked by <-- HERE in m/%s/
+=item False [] range "%s" in regex; marked by S<<-- HERE> in m/%s/
(W regexp)(F) A character class range must start and end at a literal
character, not another character class like C<\d> or C<[:alpha:]>. The "-"
in your false range is interpreted as a literal "-". In a C<(?[...])>
construct, this is an error, rather than a warning. Consider quoting
-the "-", "\-". The <-- HERE shows whereabouts in the regular expression
+the "-", "\-". The S<<-- HERE> shows whereabouts in the regular expression
the problem was discovered. See L<perlre>.
=item Fatal VMS error (status=%d) at %s, line %d
@@ -2154,7 +2161,7 @@ the indicated subroutine hasn't been defined, or if it was, it
has since been undefined.
=item Group name must start with a non-digit word character in regex; marked by
-<-- HERE in m/%s/
+S<<-- HERE> in m/%s/
(F) Group names must follow the rules for perl identifiers, meaning
they must start with a non-digit word character. A common cause of
@@ -2198,7 +2205,8 @@ about 250 characters for simple names, and somewhat more for compound
names (like C<$A::B>). You've exceeded Perl's limits. Future versions
of Perl are likely to eliminate these arbitrary limitations.
-=item Ignoring zero length \N{} in character class in regex; marked by <-- HERE in m/%s/
+=item Ignoring zero length \N{} in character class in regex; marked by
+S<<-- HERE> in m/%s/
(W regexp) Named Unicode character escapes C<(\N{...})> may return a
zero-length sequence. When such an escape is used in a character class
@@ -2275,7 +2283,7 @@ two from 1 to 32 (or 64, if your platform supports that).
(W digit) You may have tried to use an 8 or 9 in an octal number.
Interpretation of the octal number stopped before the 8 or 9.
-=item Illegal pattern in regex; marked by <-- HERE in m/%s/
+=item Illegal pattern in regex; marked by S<<-- HERE> in m/%s/
(F) You wrote something like
@@ -2314,7 +2322,8 @@ would otherwise result in the same message being repeated.
Failure of user callbacks dispatched using the C<G_KEEPERR> flag could
also result in this warning. See L<perlcall/G_KEEPERR>.
-=item Incomplete expression within '(?[ ])' in regex; marked by <-- HERE in m/%s/
+=item Incomplete expression within '(?[ ])' in regex; marked by S<<-- HERE>
+in m/%s/
(F) There was a syntax error within the C<(?[ ])>. This can happen if the
expression inside the construct was completely empty, or if there are
@@ -2402,7 +2411,8 @@ expression that contains a call to a user-defined character property
function, i.e. C<\p{IsFoo}> or C<\p{InFoo}>.
See L<perlunicode/User-Defined Character Properties> and L<perlsec>.
-=item In '(?...)', splitting the initial '(?' is deprecated in regex; marked by <-- HERE in m/%s/
+=item In '(?...)', splitting the initial '(?' is deprecated in regex;
+marked by S<<-- HERE> in m/%s/
(D regexp, deprecated) The two-character sequence C<"(?"> in
this context in a regular expression pattern should be an
@@ -2449,10 +2459,10 @@ because there is no rational reason for a version to try and use an
element larger than typically 2**32. This is usually caused by trying
to use some odd mathematical operation as a version, like 100/9.
-=item Internal disaster in regex; marked by <-- HERE in m/%s/
+=item Internal disaster in regex; marked by S<<-- HERE> in m/%s/
(P) Something went badly wrong in the regular expression parser.
-The <-- HERE shows whereabouts in the regular expression the problem was
+The S<<-- HERE> shows whereabouts in the regular expression the problem was
discovered.
=item Internal inconsistency in tracking vforks
@@ -2473,10 +2483,10 @@ by "p" (e.g., "%7p") are reserved for future use. If you see this
message, then an XS module tried to call that routine with one such
reserved format.
-=item Internal urp in regex; marked by <-- HERE in m/%s/
+=item Internal urp in regex; marked by S<<-- HERE> in m/%s/
(P) Something went badly awry in the regular expression parser. The
-<-- HERE shows whereabouts in the regular expression the problem was
+S<<-- HERE> shows whereabouts in the regular expression the problem was
discovered.
=item %s (...) interpreted as function
@@ -2496,7 +2506,8 @@ by Perl or by a user-supplied handler. See L<attributes>.
(F) The indicated attributes for a subroutine or variable were not
recognized by Perl or by a user-supplied handler. See L<attributes>.
-=item Invalid character in charnames alias definition; marked by <-- HERE in '%s
+=item Invalid character in charnames alias definition; marked by
+S<<-- HERE> in '%s
(F) You tried to create a custom alias for a character name, with
the C<:alias> option to C<use charnames> and the specified character in
@@ -2508,7 +2519,7 @@ the indicated name isn't valid. See L<charnames/CUSTOM ALIASES>.
arguments produce a warning as of 5.20. The parts after the \0 were
formerly ignored by system calls.
-=item Invalid character in \N{...}; marked by <-- HERE in \N{%s}
+=item Invalid character in \N{...}; marked by S<<-- HERE> in \N{%s}
(F) Only certain characters are valid for character names. The
indicated one isn't. See L<charnames/CUSTOM ALIASES>.
@@ -2518,20 +2529,20 @@ indicated one isn't. See L<charnames/CUSTOM ALIASES>.
(W printf) Perl does not understand the given format conversion. See
L<perlfunc/sprintf>.
-=item Invalid escape in the specified encoding in regex; marked by <-- HERE in
-m/%s/
+=item Invalid escape in the specified encoding in regex; marked by
+S<<-- HERE> in m/%s/
(W regexp) The numeric escape (for example C<\xHH>) of value < 256
didn't correspond to a single character through the conversion
from the encoding specified by the encoding pragma.
The escape was replaced with REPLACEMENT CHARACTER (U+FFFD) instead.
-The <-- HERE shows whereabouts in the regular expression the
+The S<<-- HERE> shows whereabouts in the regular expression the
escape was discovered.
=item Invalid hexadecimal number in \N{U+...}
-=item Invalid hexadecimal number in \N{U+...} in regex; marked by <-- HERE in
-m/%s/
+=item Invalid hexadecimal number in \N{U+...} in regex; marked by
+S<<-- HERE> in m/%s/
(F) The character constant represented by C<...> is not a valid hexadecimal
number. Either it is empty, or you tried to use a character other than
@@ -2563,12 +2574,12 @@ character (U+FFFD).
with the B<-D> option with no flags to see the list of acceptable values.
See also L<perlrun/-Dletters>.
-=item Invalid [] range "%s" in regex; marked by <-- HERE in m/%s/
+=item Invalid [] range "%s" in regex; marked by S<<-- HERE> in m/%s/
(F) The range specified in a character class had a minimum character
greater than the maximum character. One possibility is that you forgot the
C<{}> from your ending C<\x{}> - C<\x> without the curly braces can go only
-up to C<ff>. The <-- HERE shows whereabouts in the regular expression the
+up to C<ff>. The S<<-- HERE> shows whereabouts in the regular expression the
problem was discovered. See L<perlre>.
=item Invalid range "%s" in transliteration operator
@@ -2626,7 +2637,8 @@ for more details on allowed version formats.
Perhaps the internals were modified directly in some way or
an arbitrary reference was blessed into the "version" class.
-=item In '(*VERB...)', splitting the initial '(*' is deprecated in regex; marked by <-- HERE in m/%s/
+=item In '(*VERB...)', splitting the initial '(*' is deprecated in regex;
+marked by S<<-- HERE> in m/%s/
(D regexp, deprecated) The two-character sequence C<"(*"> in
this context in a regular expression pattern should be an
@@ -2904,10 +2916,11 @@ rules and perl was unable to guess how to make more progress.
(F) Perl thought it was reading UTF-16 encoded character data but while
doing it Perl met a malformed Unicode surrogate.
-=item %s matches null string many times in regex; marked by <-- HERE in m/%s/
+=item %s matches null string many times in regex; marked by S<<-- HERE> in
+m/%s/
(W regexp) The pattern you've specified would be an infinite loop if the
-regular expression engine didn't specifically check for that. The <-- HERE
+regular expression engine didn't specifically check for that. The S<<-- HERE>
shows whereabouts in the regular expression the problem was discovered.
See L<perlre>.
@@ -2963,7 +2976,7 @@ immediately after the switch, without intervening spaces.
=item Missing braces on \N{}
-=item Missing braces on \N{} in regex; marked by <-- HERE in m/%s/
+=item Missing braces on \N{} in regex; marked by S<<-- HERE> in m/%s/
(F) Wrong syntax of character name literal C<\N{charname}> within
double-quotish context. This can also happen when there is a space
@@ -3011,7 +3024,7 @@ can vary from one line to the next.
(S syntax) This is an educated guess made in conjunction with the message
"%s found where operator expected". Often the missing operator is a comma.
-=item Missing right brace on \%c{} in regex; marked by <-- HERE in m/%s/
+=item Missing right brace on \%c{} in regex; marked by S<<-- HERE> in m/%s/
(F) Missing right brace in C<\x{...}>, C<\p{...}>, C<\P{...}>, or C<\N{...}>.
@@ -3144,19 +3157,19 @@ local() if you want to localize a package variable.
=item Name "%s::%s" used only once: possible typo
-(W once) Typographical errors often show up as unique variable names.
-If you had a good reason for having a unique name, then just mention it
-again somehow to suppress the message. The C<our> declaration is provided
-for this purpose.
+(W once) Typographical errors often show up as unique variable
+names. If you had a good reason for having a unique name, then
+just mention it again somehow to suppress the message. The C<our>
+declaration is provided for this purpose.
-NOTE: This warning detects symbols that have been used only once so $c, @c,
-%c, *c, &c, sub c{}, c(), and c (the filehandle or format) are considered
-the same; if a program uses $c only once but also uses any of the others it
-will not trigger this warning. Symbols beginning with an underscore and
-symbols using special identifiers (q.v. L<perldata>) are exempt from this
-warning.
+NOTE: This warning detects symbols that have been used only once
+so $c, @c, %c, *c, &c, sub c{}, c(), and c (the filehandle or
+format) are considered the same; if a program uses $c only once
+but also uses any of the others it will not trigger this warning.
+Symbols beginning with an underscore and symbols using special
+identifiers (q.v. L<perldata>) are exempt from this warning.
-=item Need exactly 3 octal digits in regex; marked by <-- HERE in m/%s/
+=item Need exactly 3 octal digits in regex; marked by S<<-- HERE> in m/%s/
(F) Within S<C<(?[ ])>>, all constants interpreted as octal need to be
exactly 3 digits long. This helps catch some ambiguities. If your
@@ -3190,10 +3203,10 @@ length that is less than 0. This is difficult to imagine.
(F) When C<vec> is called in an lvalue context, the second argument must be
greater than or equal to zero.
-=item Nested quantifiers in regex; marked by <-- HERE in m/%s/
+=item Nested quantifiers in regex; marked by S<<-- HERE> in m/%s/
(F) You can't quantify a quantifier without intervening parentheses.
-So things like ** or +* or ?* are illegal. The <-- HERE shows
+So things like ** or +* or ?* are illegal. The S<<-- HERE> shows
whereabouts in the regular expression the problem was discovered.
Note that the minimal matching quantifiers, C<*?>, C<+?>, and
@@ -3211,14 +3224,25 @@ real method in a real package, and it could not find such a context.
See L<mro>.
=item \N in a character class must be a named character: \N{...} in regex;
-marked by <-- HERE in m/%s/
+marked by S<<-- HERE> in m/%s/
-(F) The new (5.12) meaning of C<\N> as C<[^\n]> is not valid in
-a bracketed character class, for the same reason that C<.> in
-a character class loses its specialness: it matches almost
-everything, which is probably not what you want.
+(F) The new (as of Perl 5.12) meaning of C<\N> as C<[^\n]> is not valid in a
+bracketed character class, for the same reason that C<.> in a character
+class loses its specialness: it matches almost everything, which is
+probably not what you want.
+
+=item \N{} in character class restricted to one character in regex; marked
+by S<<-- HERE> in m/%s/
+
+(F) Named Unicode character escapes C<(\N{...})> may return a
+multi-character sequence. Such an escape may not be used in
+a character class, because character classes always match one
+character of input. Check that the correct escape has been used,
+and the correct charname handler is in scope. The S<<-- HERE> shows
+whereabouts in the regular expression the problem was discovered.
-=item \N{NAME} must be resolved by the lexer in regex; marked by <-- HERE in m/%s/
+=item \N{NAME} must be resolved by the lexer in regex; marked by
+S<<-- HERE> in m/%s/
(F) When compiling a regex pattern, an unresolved named character or
sequence was encountered. This can happen in any of several ways that
@@ -3338,7 +3362,7 @@ in the remaining packages of the MRO of this class. If you don't want
it throwing an exception, use C<maybe::next::method>
or C<next::can>. See L<mro>.
-=item Non-hex character in regex; marked by <-- HERE in m/%s/
+=item Non-hex character in regex; marked by S<<-- HERE> in m/%s/
(F) In a regular expression, there was a non-hexadecimal character where
a hex one was expected, like
@@ -3346,7 +3370,7 @@ a hex one was expected, like
(?[ [ \xDG ] ])
(?[ [ \x{DEKA} ] ])
-=item Non-octal character in regex; marked by <-- HERE in m/%s/
+=item Non-octal character in regex; marked by S<<-- HERE> in m/%s/
(F) In a regular expression, there was a non-octal character where
an octal one was expected, like
@@ -3497,7 +3521,7 @@ supplied. See L<perlform>.
of Perl. Check the #! line, or manually feed your script into Perl
yourself.
-=item (?[...]) not valid in locale in regex; marked by <-- HERE in m/%s/
+=item (?[...]) not valid in locale in regex; marked by S<<-- HERE> in m/%s/
(F) C<(?[...])> cannot be used within the scope of a C<S<use locale>> or with
an C</l> regular expression modifier, as that would require deferring
@@ -3618,7 +3642,8 @@ a symbol (glob or scalar) that already holds a filehandle.
Although legal, this idiom might render your code confusing
and is deprecated.
-=item Operand with no preceding operator in regex; marked by <-- HERE in m/%s/
+=item Operand with no preceding operator in regex; marked by S<<-- HERE> in
+m/%s/
(F) You wrote something like
@@ -3853,7 +3878,7 @@ the glob and a destructor that adds a new object to the glob.
=item panic: kid popen errno read
-(F) forked child returned an incomprehensible message about its errno.
+(F) A forked child returned an incomprehensible message about its errno.
=item panic: last, type=%u
@@ -3951,9 +3976,9 @@ then discovered it wasn't a subroutine or eval context.
(P) scan_num() got called on something that wasn't a number.
-=item panic: Sequence (?{...}): no code block found
+=item panic: Sequence (?{...}): no code block found in regex m/%s/
-(P) while compiling a pattern that has embedded (?{}) or (??{}) code
+(P) While compiling a pattern that has embedded (?{}) or (??{}) code
blocks, perl couldn't locate the code block that should have already been
seen and compiled by perl before control passed to the regex compiler.
@@ -4043,7 +4068,7 @@ redirected it with select().)
that a method requires a package that has not been loaded.
=item Perl folding rules are not up-to-date for 0x%X; please use the perlbug
-utility to report; in regex; marked by <-- HERE in m/%s/
+utility to report; in regex; marked by S<<-- HERE> in m/%s/
(S regexp) You used a regular expression with case-insensitive matching,
and there is a bug in Perl in which the built-in regular expression
@@ -4142,9 +4167,9 @@ fine from VMS' perspective, it's probably not what you intended.
(F) The unpack format P must have an explicit size, not "*".
-=item POSIX class [:%s:] unknown in regex; marked by <-- HERE in m/%s/
+=item POSIX class [:%s:] unknown in regex; marked by S<<-- HERE> in m/%s/
-(F) The class in the character class [: :] syntax is unknown. The <-- HERE
+(F) The class in the character class [: :] syntax is unknown. The S<<-- HERE>
shows whereabouts in the regular expression the problem was discovered.
Note that the POSIX character classes do B<not> have the C<is> prefix
the corresponding C interfaces have: in other words, it's C<[[:print:]]>,
@@ -4156,33 +4181,33 @@ not C<isprint>. See L<perlre>.
the BSD version, which takes a pid.
=item POSIX syntax [%c %c] belongs inside character classes in regex; marked by
-<-- HERE in m/%s/
+S<<-- HERE> in m/%s/
(W regexp) The character class constructs [: :], [= =], and [. .] go
I<inside> character classes, the [] are part of the construct, for example:
/[012[:alpha:]345]/. Note that [= =] and [. .] are not currently
implemented; they are simply placeholders for future extensions and
-will cause fatal errors. The <-- HERE shows whereabouts in the regular
+will cause fatal errors. The S<<-- HERE> shows whereabouts in the regular
expression the problem was discovered. See L<perlre>.
=item POSIX syntax [. .] is reserved for future extensions in regex; marked by
-<-- HERE in m/%s/
+S<<-- HERE> in m/%s/
(F) Within regular expression character classes ([]) the syntax beginning
with "[." and ending with ".]" is reserved for future extensions. If you
need to represent those character sequences inside a regular expression
character class, just quote the square brackets with the backslash: "\[."
-and ".\]". The <-- HERE shows whereabouts in the regular expression the
+and ".\]". The S<<-- HERE> shows whereabouts in the regular expression the
problem was discovered. See L<perlre>.
=item POSIX syntax [= =] is reserved for future extensions in regex; marked by
-<-- HERE in m/%s/
+S<<-- HERE> in m/%s/
(F) Within regular expression character classes ([]) the syntax beginning
with "[=" and ending with "=]" is reserved for future extensions. If you
need to represent those character sequences inside a regular expression
character class, just quote the square brackets with the backslash: "\[="
-and "=\]". The <-- HERE shows whereabouts in the regular expression the
+and "=\]". The S<<-- HERE> shows whereabouts in the regular expression the
problem was discovered. See L<perlre>.
=item Possible attempt to put comments in qw() list
@@ -4344,7 +4369,7 @@ port. One can easily disable this by appropriate sighandlers, see
L<perlipc/"Signals">. See also "Process terminated by SIGTERM/SIGINT"
in L<perlos2>.
-=item Property '%s' is unknown in regex; marked by <-- HERE in m/%s/
+=item Property '%s' is unknown in regex; marked by S<<-- HERE> in m/%s/
(F) The named property which you specified via C<\p> or C<\P> is not one
known to Perl. Perhaps you misspelled the name? See
@@ -4400,21 +4425,23 @@ is true for "LATIN SMALL LETTER Y WITH DIAERESIS", but since the upper
case of that character is not in Latin1, in that locale it doesn't
change when upper cased.
-=item Quantifier follows nothing in regex; marked by <-- HERE in m/%s/
+=item Quantifier follows nothing in regex; marked by S<<-- HERE> in m/%s/
(F) You started a regular expression with a quantifier. Backslash it if
-you meant it literally. The <-- HERE shows whereabouts in the regular
+you meant it literally. The S<<-- HERE> shows whereabouts in the regular
expression the problem was discovered. See L<perlre>.
-=item Quantifier in {,} bigger than %d in regex; marked by <-- HERE in m/%s/
+=item Quantifier in {,} bigger than %d in regex; marked by S<<-- HERE> in
+m/%s/
(F) There is currently a limit to the size of the min and max values of
-the {min,max} construct. The <-- HERE shows whereabouts in the regular
+the {min,max} construct. The S<<-- HERE> shows whereabouts in the regular
expression the problem was discovered. See L<perlre>.
=item Quantifier {n,m} with n > m can't match in regex
-=item Quantifier {n,m} with n > m can't match in regex; marked by <-- HERE in m/%s/
+=item Quantifier {n,m} with n > m can't match in regex; marked by
+S<<-- HERE> in m/%s/
(W regexp) Minima should be less than or equal to maxima. If you really
want your regexp to match something 0 times, just put {0}.
@@ -4510,14 +4537,15 @@ to use parens. In any case, a hash requires key/value B<pairs>.
(W misc) You have attempted to weaken a reference that is already weak.
Doing so has no effect.
-=item Reference to invalid group 0 in regex; marked by <-- HERE in m/%s/
+=item Reference to invalid group 0 in regex; marked by S<<-- HERE> in m/%s/
(F) You used C<\g0> or similar in a regular expression. You may refer
to capturing parentheses only with strictly positive integers
(normal backreferences) or with strictly negative integers (relative
backreferences). Using 0 does not make sense.
-=item Reference to nonexistent group in regex; marked by <-- HERE in m/%s/
+=item Reference to nonexistent group in regex; marked by S<<-- HERE> in
+m/%s/
(F) You used something like C<\7> in your regular expression, but there are
not at least seven sets of capturing parentheses in the expression. If
@@ -4527,7 +4555,8 @@ expression, prepend zeroes to make it three digits long: C<\007>
The <-- HERE shows whereabouts in the regular expression the problem was
discovered.
-=item Reference to nonexistent named group in regex; marked by <-- HERE in m/%s/
+=item Reference to nonexistent named group in regex; marked by S<<-- HERE>
+in m/%s/
(F) You used something like C<\k'NAME'> or C<< \k<NAME> >> in your regular
expression, but there is no corresponding named capturing parentheses
@@ -4537,8 +4566,8 @@ spelled correctly both in the backreference and the declaration.
The <-- HERE shows whereabouts in the regular expression the problem was
discovered.
-=item Reference to nonexistent or unclosed group in regex; marked by <-- HERE
-in m/%s/
+=item Reference to nonexistent or unclosed group in regex; marked by
+S<<-- HERE> in m/%s/
(F) You used something like C<\g{-7}> in your regular expression, but there
are not at least seven sets of closed capturing parentheses in the
@@ -4554,7 +4583,10 @@ expression compiler gave it.
=item Regexp modifier "/%c" may appear a maximum of twice
-(F syntax, regexp) The regular expression pattern had too many occurrences
+=item Regexp modifier "%c" may appear a maximum of twice in regex; marked
+by S<<-- HERE> in m/%s/
+
+(F) The regular expression pattern had too many occurrences
of the specified modifier. Remove the extraneous ones.
=item Regexp modifier "%c" may not appear after the "-" in regex; marked by <--
@@ -4567,12 +4599,18 @@ the minus), instead of the one you want to turn off.
=item Regexp modifier "/%c" may not appear twice
-(F syntax, regexp) The regular expression pattern had too many occurrences
+=item Regexp modifier "%c" may not appear twice in regex; marked by <--
+HERE in m/%s/
+
+(F) The regular expression pattern had too many occurrences
of the specified modifier. Remove the extraneous ones.
=item Regexp modifiers "/%c" and "/%c" are mutually exclusive
-(F syntax, regexp) The regular expression pattern had more than one of these
+=item Regexp modifiers "%c" and "%c" are mutually exclusive in regex;
+marked by S<<-- HERE> in m/%s/
+
+(F) The regular expression pattern had more than one of these
mutually exclusive modifiers. Retain only the modifier that is
supposed to be there.
@@ -4709,23 +4747,25 @@ scalar that had previously been marked as free.
(W closed) The socket you're sending to got itself closed sometime
before now. Check your control flow.
-=item Sequence (? incomplete in regex; marked by <-- HERE in m/%s/
+=item Sequence (? incomplete in regex; marked by S<<-- HERE> in m/%s/
(F) A regular expression ended with an incomplete extension (?. The
-<-- HERE shows whereabouts in the regular expression the problem was
+S<<-- HERE> shows whereabouts in the regular expression the problem was
discovered. See L<perlre>.
-=item Sequence (?%s...) not implemented in regex; marked by <-- HERE in m/%s/
+=item Sequence (?%c...) not implemented in regex; marked by S<<-- HERE> in
+m/%s/
(F) A proposed regular expression extension has the character reserved
-but has not yet been written. The <-- HERE shows whereabouts in the
+but has not yet been written. The S<<-- HERE> shows whereabouts in the
regular expression the problem was discovered. See L<perlre>.
-=item Sequence (?%s...) not recognized in regex; marked by <-- HERE in m/%s/
+=item Sequence (?%s...) not recognized in regex; marked by S<<-- HERE> in
+m/%s/
-(F) You used a regular expression extension that doesn't make sense. The
-<-- HERE shows whereabouts in the regular expression the problem was
-discovered. This happens when using the C<(?^...)> construct to tell
+(F) You used a regular expression extension that doesn't make sense.
+The S<<-- HERE> shows whereabouts in the regular expression the problem was
+discovered. This may happen when using the C<(?^...)> construct to tell
Perl to use the default regular expression modifiers, and you
redundantly specify a default modifier. For other
causes, see L<perlre>.
@@ -4736,7 +4776,23 @@ causes, see L<perlre>.
parenthesis. Embedded parentheses aren't allowed. See
L<perlre>.
-=item Sequence \%s... not terminated in regex; marked by <-- HERE in m/%s/
+=item Sequence (?%c... not terminated in regex; marked by S<<-- HERE>
+in m/%s/
+
+(F) A named group of the form C<(?'...')> or C<< (?<...>) >> was missing the final
+closing quote or angle bracket. The S<<-- HERE> shows whereabouts in the
+regular expression the problem was discovered.
+
+=item Sequence (?(%c... not terminated in regex; marked by S<<-- HERE>
+in m/%s/
+
+(F) A named reference of the form C<(?('...')...)> or C<< (?(<...>)...) >> was
+missing the final closing quote or angle bracket after the name. The
+S<<-- HERE> shows whereabouts in the regular expression the problem was
+discovered.
+
+=item Sequence \%s... not terminated in regex; marked by S<<-- HERE> in
+m/%s/
(F) The regular expression expects a mandatory argument following the escape
sequence and this has been omitted or incorrectly written.
@@ -4746,6 +4802,18 @@ sequence and this has been omitted or incorrectly written.
(F) The end of the perl code contained within the {...} must be
followed immediately by a ')'.
+=item Sequence ?P=... not terminated in regex; marked by S<<-- HERE> in
+m/%s/
+
+(F) A named reference of the form C<(?P=...)> was missing the final
+closing parenthesis after the name. The S<<-- HERE> shows whereabouts
+in the regular expression the problem was discovered.
+
+=item Sequence (?R) not terminated in regex m/%s/
+
+(F) An C<(?R)> or C<(?0)> sequence in a regular expression was missing the
+final parenthesis.
+
=item Server error (a.k.a. "500 Server error")
(A) This is the error message generally seen in a browser window
@@ -5020,7 +5088,7 @@ inferior to its current type.
Unicode characters.
=item Switch (?(condition)... contains too many branches in regex; marked by
-<-- HERE in m/%s/
+S<<-- HERE> in m/%s/
(F) A (?(condition)if-clause|else-clause) construct can have at most
two branches (the if-clause and the else-clause). If you want one or
@@ -5029,13 +5097,14 @@ it in clustering parentheses:
(?(condition)(?:this|that|other)|else-clause)
-The <-- HERE shows whereabouts in the regular expression the problem
+The S<<-- HERE> shows whereabouts in the regular expression the problem
was discovered. See L<perlre>.
-=item Switch condition not recognized in regex; marked by <-- HERE in m/%s/
+=item Switch condition not recognized in regex; marked by S<<-- HERE> in
+m/%s/
(F) If the argument to the (?(...)if-clause|else-clause) construct is
-a number, it can be only a number. The <-- HERE shows whereabouts in
+a number, it can be only a number. The S<<-- HERE> shows whereabouts in
the regular expression the problem was discovered. See L<perlre>.
=item switching effective %s is not implemented
@@ -5415,7 +5484,8 @@ Check the #! line, or manually feed your script into Perl yourself.
(F) The unexec() routine failed for some reason. See your local FSF
representative, who probably put it there in the first place.
-=item Unexpected binary operator '%c' with no preceding operand in regex; marked by <-- HERE in m/%s/
+=item Unexpected binary operator '%c' with no preceding operand in regex;
+marked by S<<-- HERE> in m/%s/
(F) You had something like this:
@@ -5424,7 +5494,7 @@ representative, who probably put it there in the first place.
where the C<"|"> is a binary operator with an operand on the right, but
no operand on the left.
-=item Unexpected character in regex; marked by <-- HERE in m/%s/
+=item Unexpected character in regex; marked by S<<-- HERE> in m/%s/
(F) You had something like this:
@@ -5453,7 +5523,7 @@ C<PERL_EXIT_WARN> was set in C<PL_exit_flags>.
(S) An uncaught die() was called when C<PERL_EXIT_WARN> was set in
C<PL_exit_flags>.
-=item Unexpected ')' in regex; marked by <-- HERE in m/%s/
+=item Unexpected ')' in regex; marked by S<<-- HERE> in m/%s/
(F) You had something like this:
@@ -5463,7 +5533,8 @@ The C<")"> is out-of-place. Something apparently was supposed to
be combined with the digits, or the C<"+"> shouldn't be there, or
something like that. Perl can't figure out what was intended.
-=item Unexpected '(' with no preceding operator in regex; marked by <-- HERE in m/%s/
+=item Unexpected '(' with no preceding operator in regex; marked by
+S<<-- HERE> in m/%s/
(F) You had something like this:
@@ -5548,7 +5619,8 @@ this error. Likely what was meant instead was:
(W) You tried to use an unknown subpragma of the "re" pragma.
-=item Unknown switch condition (?(...)) in regex; marked by <-- HERE in m/%s/
+=item Unknown switch condition (?(...)) in regex; marked by S<<-- HERE> in
+m/%s/
(F) The condition part of a (?(condition)if-clause|else-clause) construct
is not known. The condition must be one of the following:
@@ -5576,7 +5648,7 @@ of the C<-C> switch for the list of known options.
(F) You specified an unknown Unicode option. See L<perlrun> documentation
of the C<-C> switch for the list of known options.
-=item Unknown verb pattern '%s' in regex; marked by <-- HERE in m/%s/
+=item Unknown verb pattern '%s' in regex; marked by S<<-- HERE> in m/%s/
(F) You either made a typo or have incorrectly put a C<*> quantifier
after an open brace in your pattern. Check the pattern and review
@@ -5591,7 +5663,7 @@ Note that if you want to enable a warnings category registered by a
module (e.g. C<use warnings 'File::Find'>), you must have loaded this
module first.
-=item Unmatched '[' in POSIX class in regex; marked by <-- HERE in m/%s/
+=item Unmatched '[' in POSIX class in regex; marked by S<<-- HERE> in m/%s/
(F) You had something like this:
@@ -5601,7 +5673,8 @@ That should be written:
(?[ [:digit:] ])
-=item Unmatched '%c' in POSIX class in regex; marked by <-- HERE in m/%s/
+=item Unmatched '%c' in POSIX class in regex; marked by S<<-- HERE> in
+m/%s/
(F) You had something like this:
@@ -5611,20 +5684,20 @@ There should be a second C<":">, like this:
(?[ [:alnum:] ])
-=item Unmatched [ in regex; marked by <-- HERE in m/%s/
+=item Unmatched [ in regex; marked by S<<-- HERE> in m/%s/
(F) The brackets around a character class must match. If you wish to
include a closing bracket in a character class, backslash it or put it
-first. The <-- HERE shows whereabouts in the regular expression the
+first. The S<<-- HERE> shows whereabouts in the regular expression the
problem was discovered. See L<perlre>.
-=item Unmatched ( in regex; marked by <-- HERE in m/%s/
+=item Unmatched ( in regex; marked by S<<-- HERE> in m/%s/
-=item Unmatched ) in regex; marked by <-- HERE in m/%s/
+=item Unmatched ) in regex; marked by S<<-- HERE> in m/%s/
(F) Unbackslashed parentheses must always be balanced in regular
expressions. If you're a vi user, the % key is valuable for finding
-the matching parenthesis. The <-- HERE shows whereabouts in the
+the matching parenthesis. The S<<-- HERE> shows whereabouts in the
regular expression the problem was discovered. See L<perlre>.
=item Unmatched right %s bracket
@@ -5641,25 +5714,27 @@ reserved word. It's best to put such a word in quotes, or capitalize it
somehow, or insert an underbar into it. You might also declare it as a
subroutine.
-=item Unrecognized character %s; marked by <-- HERE after %s near column %d
+=item Unrecognized character %s; marked by S<<-- HERE> after %s near column
+%d
(F) The Perl parser has no idea what to do with the specified character
in your Perl script (or eval) near the specified column. Perhaps you tried
to run a compressed script, a binary program, or a directory as a Perl program.
-=item Unrecognized escape \%c in character class in regex; marked by <-- HERE in m/%s/
+=item Unrecognized escape \%c in character class in regex; marked by
+S<<-- HERE> in m/%s/
(F) You used a backslash-character combination which is not
recognized by Perl inside character classes. This is a fatal
error when the character class is used within C<(?[ ])>.
=item Unrecognized escape \%c in character class passed through in regex;
-marked by <-- HERE in m/%s/
+marked by S<<-- HERE> in m/%s/
(W regexp) You used a backslash-character combination which is not
recognized by Perl inside character classes. The character was
understood literally, but this may change in a future version of Perl.
-The <-- HERE shows whereabouts in the regular expression the
+The S<<-- HERE> shows whereabouts in the regular expression the
escape was discovered.
=item Unrecognized escape \%c passed through
@@ -5668,11 +5743,12 @@ escape was discovered.
recognized by Perl. The character was understood literally, but this may
change in a future version of Perl.
-=item Unrecognized escape \%s passed through in regex; marked by <-- HERE in m/%s/
+=item Unrecognized escape \%s passed through in regex; marked by
+S<<-- HERE> in m/%s/
(W regexp) You used a backslash-character combination which is not
recognized by Perl. The character(s) were understood literally, but
-this may change in a future version of Perl. The <-- HERE shows
+this may change in a future version of Perl. The S<<-- HERE> shows
whereabouts in the regular expression the escape was discovered.
=item Unrecognized signal name "%s"
@@ -5752,9 +5828,9 @@ instead of:
<<"foo"
-=item Unterminated \g... pattern in regex; marked by <-- HERE in m/%s/
+=item Unterminated \g... pattern in regex; marked by S<<-- HERE> in m/%s/
-=item Unterminated \g{...} pattern in regex; marked by <-- HERE in m/%s/
+=item Unterminated \g{...} pattern in regex; marked by S<<-- HERE> in m/%s/
(F) In a regular expression, you had a C<\g> that wasn't followed by a
proper group reference. In the case of C<\g{>, the closing brace is
@@ -5768,12 +5844,13 @@ a term, so it's looking for the corresponding right angle bracket, and
not finding it. Chances are you left some needed parentheses out
earlier in the line, and you really meant a "less than".
-=item Unterminated verb pattern argument in regex; marked by <-- HERE in m/%s/
+=item Unterminated verb pattern argument in regex; marked by S<<-- HERE> in
+m/%s/
(F) You used a pattern of the form C<(*VERB:ARG)> but did not terminate
the pattern with a C<)>. Fix the pattern and retry.
-=item Unterminated verb pattern in regex; marked by <-- HERE in m/%s/
+=item Unterminated verb pattern in regex; marked by S<<-- HERE> in m/%s/
(F) You used a pattern of the form C<(*VERB)> but did not terminate
the pattern with a C<)>. Fix the pattern and retry.
@@ -5810,8 +5887,8 @@ arrays. C<$]> is the Perl version number in decimal.
the subroutine returned was a temporary scalar about to
be discarded, so the assignment had no effect.
-=item Useless (?-%s) - don't use /%s modifier in regex; marked by <-- HERE in
-m/%s/
+=item Useless (?-%s) - don't use /%s modifier in regex; marked by
+S<<-- HERE> in m/%s/
(W regexp) You have used an internal modifier such as (?-o) that has no
meaning unless removed from the entire regexp:
@@ -5831,7 +5908,8 @@ discovered. See L<perlre>.
but in fact the local() currently has no effect. This may change at
some point in the future, but in the meantime such code is discouraged.
-=item Useless (?%s) - use /%s modifier in regex; marked by <-- HERE in m/%s/
+=item Useless (?%s) - use /%s modifier in regex; marked by S<<-- HERE> in
+m/%s/
(W regexp) You have used an internal modifier such as (?o) that has no
meaning unless applied to the entire regexp:
@@ -5921,7 +5999,7 @@ since they are often used in statements like
String constants that would normally evaluate to 0 or 1 are warned
about.
-=item Useless use of (?-p) in regex; marked by <-- HERE in m/%s/
+=item Useless use of (?-p) in regex; marked by S<<-- HERE> in m/%s/
(W regexp) The C<p> modifier cannot be turned off once set. Trying to do
so is futile.
@@ -6147,7 +6225,8 @@ optimized into C<"that " . $foo>, and the warning will refer to the
C<concatenation (.)> operator, even though there is no C<.> in
your program.
-=item Use \x{...} for more than two hex characters in regex; marked by <-- HERE in m/%s/
+=item Use \x{...} for more than two hex characters in regex; marked by
+S<<-- HERE> in m/%s/
(F) In a regular expression, you said something like
@@ -6178,7 +6257,7 @@ allow this syntax, but shouldn't have. It is now deprecated,
and will be removed in a future version.
=item Using just the first character returned by \N{} in character class in
-regex; marked by <-- HERE in m/%s/
+regex; marked by S<<-- HERE> in m/%s/
(W regexp) A charnames handler may return a sequence of more than one
character. Currently all but the first one are discarded when used in
@@ -6297,14 +6376,14 @@ are automatically rebound to the current values of such variables.
(S printf) The %vd (s)printf format does not support version objects
with alpha parts.
-=item Verb pattern '%s' has a mandatory argument in regex; marked by <-- HERE
-in m/%s/
+=item Verb pattern '%s' has a mandatory argument in regex; marked by
+S<<-- HERE> in m/%s/
(F) You used a verb pattern that requires an argument. Supply an
argument or check that you are using the right verb.
-=item Verb pattern '%s' may not have an argument in regex; marked by <-- HERE
-in m/%s/
+=item Verb pattern '%s' may not have an argument in regex; marked by
+S<<-- HERE> in m/%s/
(F) You used a verb pattern that is not allowed an argument. Remove the
argument or check that you are using the right verb.
@@ -6422,6 +6501,14 @@ what you want, put an & in front.)
not get any randomness out of your system. This usually indicates
Something Very Wrong.
+=item Zero length \N{} in regex; marked by S<<-- HERE> in m/%s/
+
+(F) Named Unicode character escapes C<(\N{...})> may return a zero-length
+sequence. Such an escape was used in an extended character class, i.e.
+C<(?[...])>, which is not permitted. Check that the correct escape has
+been used, and the correct charnames handler is in scope. The S<<-- HERE>
+shows whereabouts in the regular expression the problem was discovered.
+
=back
=head1 SEE ALSO
diff --git a/regcomp.c b/regcomp.c
index d9e8e7e448..1b3c04d4d6 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -8968,6 +8968,7 @@ S_parse_lparen_question_flags(pTHX_ RExC_state_t *pRExC_state)
default:
fail_modifiers:
RExC_parse += UTF ? UTF8SKIP(RExC_parse) : 1;
+ /* diag_listed_as: Sequence (?%s...) not recognized in regex; marked by <-- HERE in m/%s/ */
vFAIL2utf8f("Sequence (%"UTF8f"...) not recognized",
UTF8fARG(UTF, RExC_parse-seqstart, seqstart));
/*NOTREACHED*/
@@ -9175,6 +9176,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
SV *sv_dat = reg_scan_name(pRExC_state,
SIZE_ONLY ? REG_RSN_RETURN_NULL : REG_RSN_RETURN_DATA);
if (RExC_parse == name_start || *RExC_parse != ')')
+ /* diag_listed_as: Sequence ?P=... not terminated in regex; marked by <-- HERE in m/%s/ */
vFAIL2("Sequence %.3s... not terminated",parse_start);
if (!SIZE_ONLY) {
@@ -9203,6 +9205,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
return ret;
}
RExC_parse++;
+ /* diag_listed_as: Sequence (?%s...) not recognized in regex; marked by <-- HERE in m/%s/ */
vFAIL3("Sequence (%.*s...) not recognized", RExC_parse-seqstart, seqstart);
/*NOTREACHED*/
case '<': /* (?<...) */
@@ -9222,6 +9225,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
REG_RSN_RETURN_NULL);
if (RExC_parse == name_start) {
RExC_parse++;
+ /* diag_listed_as: Sequence (?%s...) not recognized in regex; marked by <-- HERE in m/%s/ */
vFAIL3("Sequence (%.*s...) not recognized", RExC_parse-seqstart, seqstart);
/*NOTREACHED*/
}
@@ -9423,6 +9427,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
is_logical = 1;
if (*RExC_parse != '{') {
RExC_parse++;
+ /* diag_listed_as: Sequence (?%s...) not recognized in regex; marked by <-- HERE in m/%s/ */
vFAIL2utf8f(
"Sequence (%"UTF8f"...) not recognized",
UTF8fARG(UTF, RExC_parse-seqstart, seqstart));
@@ -11001,6 +11006,7 @@ tryagain:
char ch= RExC_parse[1];
if (ch != '<' && ch != '\'' && ch != '{') {
RExC_parse++;
+ /* diag_listed_as: Sequence \%s... not terminated in regex; marked by <-- HERE in m/%s/ */
vFAIL2("Sequence %.2s... not terminated",parse_start);
} else {
/* this pretty much dupes the code for (?P=...) in reg(), if
@@ -11011,6 +11017,7 @@ tryagain:
SIZE_ONLY ? REG_RSN_RETURN_NULL : REG_RSN_RETURN_DATA);
ch= (ch == '<') ? '>' : (ch == '{') ? '}' : '\'';
if (RExC_parse == name_start || *RExC_parse != ch)
+ /* diag_listed_as: Sequence \%s... not terminated in regex; marked by <-- HERE in m/%s/ */
vFAIL2("Sequence %.3s... not terminated",parse_start);
if (!SIZE_ONLY) {
diff --git a/t/lib/croak/toke b/t/lib/croak/toke
index 8e4b0338a3..90204526a3 100644
--- a/t/lib/croak/toke
+++ b/t/lib/croak/toke
@@ -9,6 +9,12 @@ eval "s//<<foo/e"; die $@
EXPECT
Can't find string terminator "foo" anywhere before EOF at (eval 1) line 1.
########
+# NAME /\N{/
+/\N{/
+EXPECT
+Missing right brace on \N{} or unescaped left brace after \N at - line 1, within pattern
+Execution of -e aborted due to compilation errors.
+########
# NAME Missing name in "my sub"
use feature 'lexical_subs'; my sub;
EXPECT
diff --git a/t/porting/diag.t b/t/porting/diag.t
index 8dece71433..95099bc0e5 100644
--- a/t/porting/diag.t
+++ b/t/porting/diag.t
@@ -17,7 +17,8 @@ plan('no_plan');
# initially so as to not create new test failures upon the initial
# creation of this test file. You probably shouldn't do it again.
# Just add the documentation instead.
-my $make_exceptions_list = ($ARGV[0]||'') eq '--make-exceptions-list';
+my $make_exceptions_list = ($ARGV[0]||'') eq '--make-exceptions-list'
+ and shift;
require 'regen/embed_lib.pl';
@@ -25,7 +26,7 @@ require 'regen/embed_lib.pl';
my @functions;
foreach (@{(setup_embed())[0]}) {
next if @$_ < 2;
- next unless $_->[2] =~ /warn|err|(\b|_)die|croak/i;
+ next unless $_->[2] =~ /warn|(?<!ov)err|(\b|_)die|croak/i;
# The flag p means that this function may have a 'Perl_' prefix
# The flag s means that this function may have a 'S_' prefix
push @functions, $_->[2];
@@ -33,14 +34,15 @@ foreach (@{(setup_embed())[0]}) {
push @functions, 'S_' . $_->[2] if $_->[0] =~ /s/;
};
-my $regcomp_re = "(?<routine>(?:ckWARN(?:\\d+)?reg\\w*|vWARN\\d+))";
-my $function_re = join '|', @functions;
my $regcomp_fail_re = '\b(?:(?:Simple_)?v)?FAIL[2-4]?(?:utf8f)?\b';
+my $regcomp_re =
+ "(?<routine>ckWARN(?:\\d+)?reg\\w*|vWARN\\d+|$regcomp_fail_re)";
+my $function_re = join '|', @functions;
my $source_msg_re =
- "(?<routine>\\bDIE\\b|$function_re|$regcomp_fail_re)";
+ "(?<routine>\\bDIE\\b|$function_re)";
my $text_re = '"(?<text>(?:\\\\"|[^"]|"\s*[A-Z_]+\s*")*)"';
my $source_msg_call_re = qr/$source_msg_re(?:_nocontext)? \s*
- \(aTHX_ \s*
+ \((?:aTHX_)? \s*
(?:packWARN\d*\((?<category>.*?)\),)? \s*
$text_re /x;
my $bad_version_re = qr{BADVERSION\([^"]*$text_re};
@@ -77,11 +79,12 @@ while (<$diagfh>) {
last;
}
- $cur_entry .= $_;
+ $cur_entry =~ s/ ?\z/ $_/;
}
$cur_entry =~ s/\n/ /gs; # Fix multi-line headers if they have \n's
$cur_entry =~ s/\s+\z//;
+ $cur_entry =~ s/[BCIFS](?:<<< (.*?) >>>|<< (.*?) >>|<(.*?)>)/$+/g;
if (exists $entries{$cur_entry} && $entries{$cur_entry}{todo}
&& !$entries{$cur_entry}{cattodo}) {
@@ -176,13 +179,17 @@ my $specialformats =
join '|', sort { length $b cmp length $a } keys %specialformats;
my $specialformats_re = qr/%$format_modifiers"\s*($specialformats)(\s*")?/;
+if (@ARGV) {
+ check_file($_) for @ARGV;
+ exit;
+}
open my $fh, '<', 'MANIFEST' or die "Can't open MANIFEST: $!";
while (my $file = <$fh>) {
chomp $file;
$file =~ s/\s+.*//;
next unless $file =~ /\.(?:c|cpp|h|xs|y)\z/ or $file =~ /^perly\./;
# OS/2 extensions have never been migrated to ext/, hence the special case:
- next if $file =~ m!\A(?:ext|dist|cpan|lib|t|os2/OS2)/!
+ next if $file =~ m!\A(?:ext|dist|cpan|lib|t|os2/OS2|x2p)/!
&& $file !~ m!\Aext/DynaLoader/!;
check_file($file);
}
@@ -234,7 +241,7 @@ sub check_file {
my $multiline = 0;
# Loop to accumulate the message text all on one line.
- if (m/\b(?:$source_msg_re(?:_nocontext)?|$regcomp_re)\s*\(/) {
+ if (m/(?!^)\b(?:$source_msg_re(?:_nocontext)?|$regcomp_re)\s*\(/) {
while (not m/\);$/) {
my $nextline = <$codefh>;
# Means we fell off the end of the file. Not terribly surprising;
@@ -271,6 +278,9 @@ sub check_file {
# Sometimes the regexp will pick up too much for the category
# e.g., WARN_UNINITIALIZED), PL_warn_uninit_sv ... up to the next )
$category && $category =~ s/\).*//s;
+ if (/win32_croak_not_implemented\(/) {
+ $name .= " not implemented!"
+ }
}
elsif (/$bad_version_re/) {
($name, $category) = ($+{'text'}, undef);
@@ -460,41 +470,89 @@ __DATA__
Malformed UTF-8 character (unexpected non-continuation byte 0x%x, immediately after start byte 0x%x)
Cannot apply "%s" in non-PerlIO perl
+Cannot set timer
+Can't find DLL name for the module `%s' by the handle %d, rc=%u=%x
Can't find string terminator %c%s%c anywhere before EOF
Can't fix broken locale name "%s"
Can't get short module name from a handle
+Can't load DLL `%s', possible problematic module `%s'
Can't locate %s: %s
Can't locate object method "%s" via package "%s" (perhaps you forgot to load "%s"?)
Can't pipe "%s": %s
+Can't set type on DOS
Can't spawn: %s
Can't spawn "%s": %s
Can't %s script `%s' with ARGV[0] being `%s'
Can't %s "%s": %s
Can't %s `%s' with ARGV[0] being `%s' (looking for executables only, not found)
Can't use string ("%s"%s) as a subroutine ref while "strict refs" in use
-\%c better written as $%c
Character(s) in '%c' format wrapped in %s
chown not implemented!
clear %s
Code missing after '/' in pack
Code missing after '/' in unpack
+Could not find version 1.1 of winsock dll
+Could not find version 2.0 of winsock dll
'%c' outside of string in pack
Debug leaking scalars child failed%s with errno %d: %s
+detach of a thread which could not start
+detach on an already detached thread
+detach on a thread with a waiter
'/' does not take a repeat count in %s
-Dp not implemented on this platform
+Empty array reference given to mod2fname
+endhostent not implemented!
+endnetent not implemented!
+endprotoent not implemented!
+endservent not implemented!
+Error loading module '%s': %s
Error reading "%s": %s
execl not implemented!
EVAL without pos change exceeded limit in regex
Filehandle opened only for %sput
Filehandle %s opened only for %sput
Filehandle STD%s reopened as %s only for input
+file_type not implemented on DOS
filter_del can only delete in reverse order (currently)
+fork() not available
+fork() not implemented!
YOU HAVEN'T DISABLED SET-ID SCRIPTS IN THE KERNEL YET! FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!
free %s
+Free to wrong pool %p not %p
+Function "endnetent" not implemented in this version of perl.
+Function "endprotoent" not implemented in this version of perl.
+Function "endservent" not implemented in this version of perl.
+Function "getnetbyaddr" not implemented in this version of perl.
+Function "getnetbyname" not implemented in this version of perl.
+Function "getnetent" not implemented in this version of perl.
+Function "getprotobyname" not implemented in this version of perl.
+Function "getprotobynumber" not implemented in this version of perl.
+Function "getprotoent" not implemented in this version of perl.
+Function "getservbyport" not implemented in this version of perl.
+Function "getservent" not implemented in this version of perl.
+Function "getsockopt" not implemented in this version of perl.
+Function "recvmsg" not implemented in this version of perl.
+Function "sendmsg" not implemented in this version of perl.
+Function "sethostent" not implemented in this version of perl.
+Function "setnetent" not implemented in this version of perl.
+Function "setprotoent" not implemented in this version of perl.
+Function "setservent" not implemented in this version of perl.
+Function "setsockopt" not implemented in this version of perl.
+Function "tcdrain" not implemented in this version of perl.
+Function "tcflow" not implemented in this version of perl.
+Function "tcflush" not implemented in this version of perl.
+Function "tcsendbreak" not implemented in this version of perl.
get %s %p %p %p
+gethostent not implemented!
+getnetbyaddr not implemented!
+getnetbyname not implemented!
+getnetent not implemented!
+getprotoent not implemented!
getpwnam returned invalid UIC %o for user "%s"
+getservent not implemented!
glob failed (can't start child: %s)
glob failed (child exited with status %d%s)
+Got an error from DosAllocMem: %i
Goto undefined subroutine
Goto undefined subroutine &%s
Got signal %d
@@ -503,6 +561,7 @@ Illegal binary digit '%c' ignored
Illegal character %sin prototype for %s : %s
Illegal hexadecimal digit '%c' ignored
Illegal octal digit '%c' ignored
+INSTALL_PREFIX too long: `%s'
Invalid argument to sv_cat_decode
Invalid range "%c-%c" in transliteration operator
Invalid separator character %c%c%c in PerlIO layer specification %s
@@ -511,65 +570,77 @@ Invalid type '%c' in pack
Invalid type '%c' in %s
Invalid type '%c' in unpack
Invalid type ',' in %s
+ioctl implemented only on sockets
ioctlsocket not implemented!
+join with a thread with a waiter
killpg not implemented!
List form of pipe open not implemented
+Looks like we have no PM; will not load DLL %s without $ENV{PERL_ASIF_PM}
Malformed integer in [] in %s
+Malformed %s
Malformed UTF-8 character (fatal)
Missing (suid) fd script name
More than one argument to open
More than one argument to open(,':%s')
-\N{} in character class restricted to one character in regex; marked by <-- HERE in m/%s/
+No message queue
No %s allowed while running setgid
No %s allowed with (suid) fdscript
Not an XSUB reference
+Not a reference given to mod2fname
+Not array reference given to mod2fname
Operator or semicolon missing before %c%s
Out of memory during list extend
+panic queryaddr
PerlApp::TextQuery: no arguments, please
POSIX syntax [%c %c] is reserved for future extensions in regex; marked by <-- HERE in m/%s/
ptr wrong %p != %p fl=%x nl=%p e=%p for %d
+QUITing...
Recompile perl with -DDEBUGGING to use -D switch (did you mean -d ?)
-Regexp modifier "%c" may appear a maximum of twice in regex; marked by <-- HERE in m/%s/
-Regexp modifier "%c" may not appear twice in regex; marked by <-- HERE in m/%s/
-Regexp modifiers "%c" and "%c" are mutually exclusive in regex; marked by <-- HERE in m/%s/
+recursion detected in %s
Regexp *+ operand could be empty in regex; marked by <-- HERE in m/%s/
Reversed %c= operator
+%s: Can't parse EXE/DLL name: '%s'
%s(%f) failed
%sCompilation failed in require
-Sequence (?%c...) not implemented in regex; marked by <-- HERE in m/%s/
-Sequence (%s...) not recognized in regex; marked by <-- HERE in m/%s/
-Sequence %s... not terminated in regex; marked by <-- HERE in m/%s/
-Sequence (?%c... not terminated in regex; marked by <-- HERE in m/%s/
-Sequence (?(%c... not terminated in regex; marked by <-- HERE in m/%s/
-Sequence (?R) not terminated in regex m/%s/
+%s: Error stripping dirs from EXE/DLL/INSTALLDIR name
+sethostent not implemented!
+setnetent not implemented!
+setprotoent not implemented!
set %s %p %p %p
+setservent not implemented!
%s free() ignored (RMAGIC, PERL_CORE)
%s has too many errors.
SIG%s handler "%s" not defined.
%s in %s
Size magic not implemented
+%s: name `%s' too long
+%s not implemented!
%s number > %s non-portable
%srealloc() %signored
%s in regex m/%s/
%s on %s %s
socketpair not implemented!
+%s: %s
Starting Full Screen process with flag=%d, mytype=%d
Starting PM process with flag=%d, mytype=%d
sv_2iv assumed (U_V(fabs((double)SvNVX(sv))) < (UV)IV_MAX) but SvNVX(sv)=%f U_V is 0x%x, IV_MAX is 0x%x
switching effective gid is not implemented
switching effective uid is not implemented
System V IPC is not implemented on this machine
--T and -B not implemented on filehandles
Terminating on signal SIG%s(%d)
The crypt() function is not implemented on NetWare
The flock() function is not implemented on NetWare
The rewinddir() function is not implemented on NetWare
The seekdir() function is not implemented on NetWare
The telldir() function is not implemented on NetWare
+This perl was compiled without taint support. Cowardly refusing to run with -t or -T flags
+This version of OS/2 does not support %s.%s
Too deeply nested ()-groups in %s
Too many args on %s line of "%s"
U0 mode on a byte string
unable to find VMSPIPE.COM for i/o piping
+Unable to locate winsock library!
+Unexpected program mode %d when morphing back from PM
Unrecognized character %s; marked by <-- HERE after %s<-- HERE near column %d
Unstable directory path, current directory changed unexpectedly
Unterminated compressed integer in unpack
@@ -591,12 +662,14 @@ Value of logical "%s" too long. Truncating to %i bytes
waitpid: process %x is not a child of process %x
Wide character
Wide character in $/
+win32_get_osfhandle() TBD on this platform
+win32_open_osfhandle() TBD on this platform
Within []-length '*' not allowed in %s
Within []-length '%c' not allowed in %s
+Wrong size of loadOrdinals array: expected %d, actual %d
Wrong syntax (suid) fd script name "%s"
'X' outside of string in %s
'X' outside of string in unpack
-Zero length \N{} in regex; marked by <-- HERE in m/%s/
__CATEGORIES__
Code point 0x%X is not Unicode, all \p{} matches fail; all \P{} matches succeed
diff --git a/toke.c b/toke.c
index cd653dd3e5..1bdeedbdd7 100644
--- a/toke.c
+++ b/toke.c
@@ -3379,6 +3379,7 @@ S_scan_const(pTHX_ char *start)
if (PL_lex_inwhat == OP_SUBST && !PL_lex_inpat &&
isDIGIT(*s) && *s != '0' && !isDIGIT(s[1]))
{
+ /* diag_listed_as: \%d better written as $%d */
Perl_ck_warner(aTHX_ packWARN(WARN_SYNTAX), "\\%c better written as $%c", *s, *s);
*--s = '$';
break;
@@ -3566,7 +3567,7 @@ S_scan_const(pTHX_ char *start)
if (! PL_lex_inpat) {
yyerror("Missing right brace on \\N{}");
} else {
- yyerror("Missing right brace on \\N{} or unescaped left brace after \\N.");
+ yyerror("Missing right brace on \\N{} or unescaped left brace after \\N");
}
continue;
}
@@ -6088,6 +6089,7 @@ Perl_yylex(pTHX)
TOKEN(0);
s++;
if (PL_lex_brackets <= 0)
+ /* diag_listed_as: Unmatched right %s bracket */
yyerror("Unmatched right square bracket");
else
--PL_lex_brackets;
@@ -6266,6 +6268,7 @@ Perl_yylex(pTHX)
rightbracket:
s++;
if (PL_lex_brackets <= 0)
+ /* diag_listed_as: Unmatched right %s bracket */
yyerror("Unmatched right curly bracket");
else
PL_expect = (expectation)PL_lex_brackstack[--PL_lex_brackets];
@@ -9665,6 +9668,7 @@ S_pmflag(pTHX_ const char* const valid_flags, U32 * pmfl, char** s, char* charse
yyerror(Perl_form(aTHX_ "Regexp modifiers \"/%c\" and \"/%c\" are mutually exclusive", *charset, c));
}
else if (c == 'a') {
+ /* diag_listed_as: Regexp modifier "/%c" may appear a maximum of twice */
yyerror("Regexp modifier \"/a\" may appear a maximum of twice");
}
else {
diff --git a/universal.c b/universal.c
index 85b91d0295..969acbd03a 100644
--- a/universal.c
+++ b/universal.c
@@ -312,15 +312,18 @@ Perl_croak_xs_usage(const CV *const cv, const char *const params)
const HV *const stash = GvSTASH(gv);
if (HvNAME_get(stash))
+ /* diag_listed_as: SKIPME */
Perl_croak_nocontext("Usage: %"HEKf"::%"HEKf"(%s)",
HEKfARG(HvNAME_HEK(stash)),
HEKfARG(GvNAME_HEK(gv)),
params);
else
+ /* diag_listed_as: SKIPME */
Perl_croak_nocontext("Usage: %"HEKf"(%s)",
HEKfARG(GvNAME_HEK(gv)), params);
} else {
/* Pants. I don't think that it should be possible to get here. */
+ /* diag_listed_as: SKIPME */
Perl_croak_nocontext("Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
}
}