Skip to content

fix: lexical warning bits (AnyEvent/cpan noise), AutoSplit mkdir, constant redefine#700

Merged
fglock merged 4 commits intomasterfrom
fix/warnings-lexical-bits
May 9, 2026
Merged

fix: lexical warning bits (AnyEvent/cpan noise), AutoSplit mkdir, constant redefine#700
fglock merged 4 commits intomasterfrom
fix/warnings-lexical-bits

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented May 9, 2026

Summary

Aligns compile-time warning checks with Perl ckWARN / ${^WARNING_BITS} (matches generated code such as AnyEvent::common_sense in constants.pl), fixes blib/lib/auto creation before AutoSplit so EU::MM matches stock behaviour, and gates constant subroutine redefined messages like Perl.

Changes

  • WarningFlags.ckWarnForScope — use $^W + lexical warning bits instead of warningManager.isWarningEnabled() (which wrongly treats globalWarningsEnabled like “almost everything on”).
  • SubroutineParser — redefine warnings (including constant subs) use ckWarnForScope(..., "redefine").
  • EmitVariable / OperatorParser — shadow / duplicate my diagnostics use shadow + ckWarnForScope.
  • ExtUtils/MakeMaker.pmmkdir -p blib/lib/auto before pm_to_blib so AutoSplit does not create the dir and warn.

Verification

  • make passes.

Documentation

Design note updated: dev/modules/anyevent_fixes.md — adds a Discussion — jcpan noise & signals (2026-05-09, PR #700) section (warnings/MakeMaker scope, t/02_signals.t analysis: forward \&_signal_exec GV stub on jperl, workarounds), and refreshes §H accordingly.

Related

./jcpan -t AnyEvent still fails t/02_signals.t (“No signal caught”) until GV/stub coderef parity for subs assigned after \&name is fixed; see dev/modules/anyevent_fixes.md.

fglock and others added 3 commits May 9, 2026 22:32
Subroutine redefinition and "masks earlier declaration" checks used
WarningFlags.warningManager.isWarningEnabled(), which falls through to
globalWarningsEnabled and treats almost every category as on once bare
use warnings ran anywhere — unlike Perl, which keys off $^W and the
lexical warning-bit string (including XOR/set via generated AnyEvent::common_sense).

- Add WarningFlags.ckWarnForScope(scope, category)
- Use it for "Subroutine ... redefined" and shadow/masking diagnostics
- Gate OperatorParser duplicate-my diagnostic on shadow like EmitVariable

Generated with [Cursor](https://cursor.com)

Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Emit Makefile mkdir for blib/lib/auto before pm_to_blib autosplit so
  AutoSplit does not create the directory and warn (matches typical EU::MM).
- Apply ckWarnForScope(redefine) to constant subroutine redefinitions,
  same as non-constant subs.

Generated with [Cursor](https://cursor.com)

Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Document warnings parity, AutoSplit mkdir, constant redefine scope and
clarify signal test failure (forward \&_signal_exec GV stub on jperl).

Generated with [Cursor](https://cursor.com)

Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@fglock fglock force-pushed the fix/warnings-lexical-bits branch from da4a415 to b30e37d Compare May 9, 2026 20:32
PR #700 gated constant "Constant subroutine … redefined" with ckWarnForScope,
which respects $^W; perl still emits that warning under local $^W=0 (see
perl5_t/t/comp/redef.t ok 19).

- Emit constant redefine unless lexical no warnings redefine (not ckWarn alone).
- Treat prior subs as constant when old prototype is "()", not only "".

Generated with [Cursor](https://cursor.com)

Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@fglock fglock merged commit 4b9a9d5 into master May 9, 2026
2 checks passed
@fglock fglock deleted the fix/warnings-lexical-bits branch May 9, 2026 21:37
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.

1 participant