-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
toke.c - rework "Perl_no_op" warnings so we call Perl_warner() once only
Using multiple calls to Perl_warner() means that fatalized warnings do not include the full diagnostics. It also means that $SIG{__WARN__} might get called more than once for a given warning, with parts of the message in each call. This would affect "missing operator" warnings, which often come up in the context of barewords and misspelled sub names. This patch moves the parenthesized "hint" part of the warning to the same line as the main warning and ensures the entire message is dispatched in a single call to Perl_warner(). The result of this is that the hint is visible even under fatalized warnings and that $SIG{__WARN__} is called only once for the warning. At the same time this patch fixes an oversight where we would sometimes form warning messages with a subject (var name or bareword name) that was unquoted and sometimes had leading whitespace. This patch changes this to quote the subject like most of our errors do and to strip the whitespace when appropriate. (Note this doesn't use the QUOTEDPREFIX formats, as it didn't seem to be necessary with the type of warnings this is involved in.) This is not done in a separate patch as it would mean manually altering all the tests multiple times over multiple patches. Note that yywarn() calls Perl_warner(), so even though this patch does not call it directly it does call it indirectly via yywarn() via yyerror(). This resolves GH Issue #20425.
- Loading branch information
Showing
13 changed files
with
108 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.