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
Custom warnings categories are disabled by any preceding no warnings 'category'
#15482
Comments
From the.rob.dixon@gmail.comCreated by the.rob.dixon@gmail.comWith this module in file My/Warnings.pm package My::Warnings; use warnings::register; sub test { 1; and this code in main.pl use strict; use warnings 'all'; use My::Warnings; print undef; # uninitialized warning given (1) { } # experimental warning My::Warnings::test(); # custom My::Warnings warning I get all three warnings output. However, changing it to use warnings 'all'; the custom category is disabled as well as the explicitly-mentioned Also, a further reenabling use warnings 'all'; leaves the custom category disabled while the "experimental" category is Moving `use My::Warnings;` to before any mention of the `warnings` pragma Perl Info
|
From @cpansproutOn Thu Jul 28 10:24:51 2016, the.rob.dixon@gmail.com wrote:
Some time ago I suspected we had a problem like this, but I never got around to looking into it (or maybe I started and then forgot). Internally perl uses a bitfield of warning categories and every time a category gets registered the bitfield grows. Additionally, it will skip the bitfield altogether for all warnings and no warnings, respectively. In your original example, ‘use warnings 'all'’ uses the special ‘all warnings’ value, and everything works. Adding ‘no warnings 'experimental'’ switches to bitfield-mode, and when the new category is registered, and the bitfield gets bigger, the new bit just ends up as 0 by default. It seems that we need a bit that records the default value for newly-registered warnings. When a special value (such as ‘all warnings’) is converted into a bitfield, that new bit will get the appropriate value, as currently happens with categories already registered. When new categories are registered, they can copy that bit. (BTW, I’m not volunteering to do any of this. But then again I might do it.) -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From zefram@fysh.orgThis was fixed by commit 006c1a1 in -zefram |
@iabyn - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been Perl 5.28.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#128765 (status was 'resolved')
Searchable as RT128765$
The text was updated successfully, but these errors were encountered: