Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 3c849777973e02cafe9c5064fafc43feb0c4e466
      
https://github.com/Perl/perl5/commit/3c849777973e02cafe9c5064fafc43feb0c4e466
  Author: Tony Cook <t...@develop-help.com>
  Date:   2023-07-25 (Tue, 25 Jul 2023)

  Changed paths:
    M op.c
    M t/lib/warnings/gv

  Log Message:
  -----------
  make sure "use VERSION;" sets the flag needed for "used only once"

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


Reply via email to