Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 01b60077c5188e465b1b2eeb5d24b79ed1e4cb95
      
https://github.com/Perl/perl5/commit/01b60077c5188e465b1b2eeb5d24b79ed1e4cb95
  Author: Tony Cook <t...@develop-help.com>
  Date:   2023-12-08 (Fri, 08 Dec 2023)

  Changed paths:
    M embed.fnc
    M embed.h
    M gv.c
    M gv.h
    M proto.h
    M t/lib/warnings/gv
    M util.c

  Log Message:
  -----------
  allow "used only once" warnings to be fatal

"used only once" warnings are special, instead of being emitted at
the code where the name in question is used, they are emitted during
a scan of the symbol table done after parsing has finished.

This meant that any FATAL flags set in the COP for the parse point of
the name is no longer in scope, so the warnings we emit can't be
treated as fatal.

To make them behave as FATAL set a new flag on the name if fatal
WARN_ONCE warnings are enabled and use that to dispatch the warnings
as normal or fatally when we do the symbol table scan.

I originally approached the dispatch as fatal or non-fatal by messing
around with cop_warnings, but that was dumb, and I went for a much
simpler change.

Fixes #13814


Reply via email to