Skip to content

Conversation

@leonerd
Copy link
Contributor

@leonerd leonerd commented Sep 18, 2025

This adds three new API functions: a pair to modify a COP by enabling or disabling a single warning bit within it, and a query function to ask if a given warning is already enabled.

This API is provided for CPAN modules to use to modify the set of warnings present in a COP during compile-time. Currently modules need to use the new_warnings_bitfield() function, which was recently hidden by 09a0707. That change broke the Syntax::Keyword::Try module, as reported in BBC ticket #23609. This change won't directly fix the BBC issue, but it will provide a new API that the module can use instead of calling the now-hidden function, so upstream will be fixed, and protected from future changes.

--

Does not current include a perldelta, but I could be convinced to add one, for this relatively obscure new API.

@leonerd leonerd force-pushed the cop_warnings_API branch 2 times, most recently from 6e47d90 to ec5fbb0 Compare September 18, 2025 20:40
@leonerd leonerd force-pushed the cop_warnings_API branch 5 times, most recently from 656e0bf to 6e197fd Compare September 22, 2025 22:52
This adds three new API functions: a pair to modify a COP by enabling or
disabling a single warning bit within it, and a query function to ask if
a given warning is already enabled.

This API is provided for CPAN modules to use to modify the set of
warnings present in a COP during compile-time. Currently modules need to
use the `new_warnings_bitfield()` function, which was recently hidden by
09a0707. That change broke the `Syntax::Keyword::Try` module, as
reported in Perl#23609.
@leonerd leonerd merged commit 215e36f into Perl:blead Sep 23, 2025
33 checks passed
@leonerd leonerd deleted the cop_warnings_API branch September 23, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants