diff options
author | Yves Orton <demerphq@gmail.com> | 2023-02-18 04:21:23 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-02-19 09:42:04 +0800 |
commit | ce94d21a89435e6f2c921e8908972f61a3e115bc (patch) | |
tree | b9218ef1e8f46cb7563eb7c8708a5504ca6e14dd | |
parent | 4f5c82918ef2c46b8533c835c64762596d672fee (diff) | |
download | perl-ce94d21a89435e6f2c921e8908972f61a3e115bc.tar.gz |
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
-rw-r--r-- | dist/Devel-PPPort/PPPort_pm.PL | 2 | ||||
-rw-r--r-- | dist/Devel-PPPort/parts/inc/misc | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/dist/Devel-PPPort/PPPort_pm.PL b/dist/Devel-PPPort/PPPort_pm.PL index 40dfc36c5a..f1c1315970 100644 --- a/dist/Devel-PPPort/PPPort_pm.PL +++ b/dist/Devel-PPPort/PPPort_pm.PL @@ -756,7 +756,7 @@ package Devel::PPPort; use strict; use vars qw($VERSION $data); -$VERSION = '3.69'; +$VERSION = '3.70'; sub _init_data { diff --git a/dist/Devel-PPPort/parts/inc/misc b/dist/Devel-PPPort/parts/inc/misc index f9c4e578cb..eb1e2b9eb8 100644 --- a/dist/Devel-PPPort/parts/inc/misc +++ b/dist/Devel-PPPort/parts/inc/misc @@ -1175,10 +1175,10 @@ newXS("Devel::PPPort::dAXMARK", XS_Devel__PPPort_dAXMARK, file); int OpSIBLING_tests() PREINIT: - OP *x; - OP *kid; - OP *middlekid; - OP *lastkid; + OP *x = NULL; + OP *kid = NULL; + OP *middlekid = NULL; + OP *lastkid = NULL; int count = 0; int failures = 0; int i; |