Skip to content

059a773b00 introduced new build-time warning #24033

@jkeenan

Description

@jkeenan

A recent commit has introduced a new build-time warning. Today I observed this while running make test_prep:

cc -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c99 -O2 -Wall -Werror=pointer-arith -Werror=vla -Wextra -Wno-long-long -Wno-declaration-after-statement -Wc++-compat -Wwrite-strings -Wno-use-after-free pp_ctl.c
In file included from perl.h:7973,
                 from pp_ctl.c:35: 
In function ‘Perl_SvREFCNT_dec’,
    inlined from ‘Perl_cx_poploop’ at inline.h:4194:13:
sv_inline.h:689:8: warning: ‘oldsv’ may be used uninitialized [-Wmaybe-uninitialized]
  689 |     if (LIKELY(sv != NULL)) {
      |        ^
In file included from perl.h:7972:
inline.h: In function ‘Perl_cx_poploop’:
inline.h:4172:17: note: ‘oldsv’ was declared here
 4172 |             SV *oldsv;
      |                 ^~~~~

Some use of git blame suggests that the commit that changed behavior was:

commit 059a773b005a5728fa6dd213c406758c1f32e1b5
Author:     Paul Evans <[email protected]>
AuthorDate: Mon Dec 22 22:47:29 2025 +0000
Commit:     Karl Williamson <[email protected]>
CommitDate: Tue Dec 23 08:55:04 2025 -0700

    Initial hack at restoring iter var value after refaliased foreach

@leonerd can you take a look? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    build-time-warningsReplaces [META] Build-time warnings RT #133556

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions