-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[doc] use v5.36, only partially enables warnings #21271
Labels
Comments
|
I guess this is a side-effect of the optimizer, because adding almost any |
tonycoz
added a commit
to tonycoz/perl5
that referenced
this issue
Jul 24, 2023
There's two parts to producing the "used only once" warning: 1. In a lexical scope with WARN_ONCE enabled, new GVs are created with the GVf_MULTI flag off, a second mention of such a name will set that flag. 2. After compilation, if G_WARN_ONCE is set in PL_dowarn, the entire package tree is walked to report names which don't have GVf_MULTI set. In this case G_WARN_ONCE wasn't being set, so the second part didn't happen. This flag is global, so using any other module that happened to enable the WARN_ONCE flag (anything that does C<use warnings;>) would allow warnings to be produced after compilation. Fixes Perl#21271
|
Perl_utilize() isn't setting I expect the other module you were |
tonycoz
added a commit
that referenced
this issue
Jul 24, 2023
There's two parts to producing the "used only once" warning: 1. In a lexical scope with WARN_ONCE enabled, new GVs are created with the GVf_MULTI flag off, a second mention of such a name will set that flag. 2. After compilation, if G_WARN_ONCE is set in PL_dowarn, the entire package tree is walked to report names which don't have GVf_MULTI set. In this case G_WARN_ONCE wasn't being set, so the second part didn't happen. This flag is global, so using any other module that happened to enable the WARN_ONCE flag (anything that does C<use warnings;>) would allow warnings to be produced after compilation. Fixes #21271
steve-m-hay
pushed a commit
that referenced
this issue
Oct 6, 2024
There's two parts to producing the "used only once" warning: 1. In a lexical scope with WARN_ONCE enabled, new GVs are created with the GVf_MULTI flag off, a second mention of such a name will set that flag. 2. After compilation, if G_WARN_ONCE is set in PL_dowarn, the entire package tree is walked to report names which don't have GVf_MULTI set. In this case G_WARN_ONCE wasn't being set, so the second part didn't happen. This flag is global, so using any other module that happened to enable the WARN_ONCE flag (anything that does C<use warnings;>) would allow warnings to be produced after compilation. Fixes #21271 (cherry picked from commit 3c84977)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
perl5360delta says:
Furthermore, use v5.36 will also enable warnings as if you'd written use warnings.but the 'once' warning is an exception:
vs:
The text was updated successfully, but these errors were encountered: