Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 6dc20c079fd2534c3c46b72016af032eb0fd0824
      
https://github.com/Perl/perl5/commit/6dc20c079fd2534c3c46b72016af032eb0fd0824
  Author: Yves Orton <[email protected]>
  Date:   2023-02-19 (Sun, 19 Feb 2023)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  toke.c - silence maybe-uninitialized warning on gcc 12

This silences the following (bogus) warning:

toke.c:12104:24: warning:
    ‘b’ may be used uninitialized [-Wmaybe-uninitialized]

It won't be used unitialized, but there is no reason not to initialize
it to shut up the warning on gcc-12

Fixes Github Issue #20816


  Commit: 553cf0eba0eec3b18c81a40d258405a01765e06d
      
https://github.com/Perl/perl5/commit/553cf0eba0eec3b18c81a40d258405a01765e06d
  Author: Yves Orton <[email protected]>
  Date:   2023-02-19 (Sun, 19 Feb 2023)

  Changed paths:
    M ext/mro/mro.pm
    M ext/mro/mro.xs

  Log Message:
  -----------
  mro.xs - silence maybe-uninitialized warning on gcc 12

Silence the following bogus warning:

    mro.xs:561:25: warning:
        ‘fq_subname_len’ may be used uninitialized [-Wmaybe-uninitialized]

    561 |             subname_len = fq_subname_len - (subname - fq_subname);

The code does not need to be structured the way it was, and we actually
don't need to define fq_subname_len at all. So restructure the code and
remove it and make gcc-12 shut up.

Fixes GH Issue #20816


  Commit: 4f5c82918ef2c46b8533c835c64762596d672fee
      
https://github.com/Perl/perl5/commit/4f5c82918ef2c46b8533c835c64762596d672fee
  Author: Yves Orton <[email protected]>
  Date:   2023-02-19 (Sun, 19 Feb 2023)

  Changed paths:
    M pp_hot.c

  Log Message:
  -----------
  pp_hot.c - rework padhv_rv2hv_common fix maybe-uninit warning on gcc 12

This function was creating a var is_tied that was not necessary,
and using unnecessarily convoluted code to achieve its goals. Its
still somewhat convoluted, but less so. Since we no longer have to
predeclare all variables, moving the bulk of the var decls down
makes the code more clear, and ensures that nothing ends up
uninitialized.

GCC 12 warnings seems to have crappy warnings and overly senstivie ones
as well. The actual usage was from line 1912 in pp_hot.c, yet the
warning mumbles a lot about embed.h. Feh. Note as far as I am concerned
this warning was bogus, except that it highlighted unnecessarily
convoluted code that should be cleaned up.

    In file included from perl.h:6197,
                     from pp_hot.c:36:
    embed.h: In function ‘S_padhv_rv2hv_common’:
    embed.h:981:49: warning:
      ‘mg’ may be used uninitialized [-Wmaybe-uninitialized]
      981 | #   define magic_scalarpack(a,b)                \
                    Perl_magic_scalarpack(aTHX_ a,b)
          |         ^~~~~~~~~~~~~~~~~~~~~
    pp_hot.c:1878:12: note: ‘mg’ was declared here
     1878 |     MAGIC *mg;
          |            ^~

Fixes Github Issue #20816


  Commit: ce94d21a89435e6f2c921e8908972f61a3e115bc
      
https://github.com/Perl/perl5/commit/ce94d21a89435e6f2c921e8908972f61a3e115bc
  Author: Yves Orton <[email protected]>
  Date:   2023-02-19 (Sun, 19 Feb 2023)

  Changed paths:
    M dist/Devel-PPPort/PPPort_pm.PL
    M dist/Devel-PPPort/parts/inc/misc

  Log Message:
  -----------
  Devel-PPPort - silence maybe-uninitialized warnings on gcc-12

GCC-12 seems to have a propensity to warning about maybe-uninitialized
variables a lot more than it should. Most of the cases I have looked
into it turns out to be a false positive, but at the same time, it is
pretty simple to fix this kind of thing, so just fix it so the darn
thing will shut up.

This one just initializes some variables to NULL at the start of a test
function.

Fixes the following (slightly elided) warning.

    gcc-12 -c ... -Og -g ... -W -Wall RealPPPort.c
    In file included from ../../perl.h:6197,
                     from RealPPPort.xs:31:
    ../../embed.h: In function ‘XS_Devel__PPPort_OpSIBLING_tests’:
    ../../embed.h:461:49:
        warning: ‘lastkid’ may be used uninitialized [-Wmaybe-uninitialized]
      461 | # define op_free(a)
                Perl_op_free(aTHX_ a)
                ^~~~~~~~~~~~
    RealPPPort.xs:1741:21: note: ‘lastkid’ was declared here
     1741 |                 OP *lastkid;
          |                     ^~~~~~~

Fixes Github Issue #20816


Compare: https://github.com/Perl/perl5/compare/3f66aba00b17...ce94d21a8943

Reply via email to