Skip Menu |

This queue is for tickets about the Scalar-List-Utils CPAN distribution.

Report information
The Basics
Id: 100741
Status: open
Priority: 0/
Queue: Scalar-List-Utils

People
Owner: Nobody in particular
Requestors: JHI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Unused but needed
Patch attached. I tried removing the variables but then t/pair.t fails. Magic. (trying to compile core exts with -Wall -Wextra)
Subject: 0001-Unused-but-needed-variables.patch
From 4bc94bef51ab17107221d6e0a657b0706be41a0c Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi <jhi@iki.fi> Date: Fri, 5 Dec 2014 21:46:10 -0500 Subject: [PATCH 1/2] Unused but needed variables. --- cpan/Scalar-List-Utils/ListUtil.xs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpan/Scalar-List-Utils/ListUtil.xs b/cpan/Scalar-List-Utils/ListUtil.xs index 515677f..f412d05 100644 --- a/cpan/Scalar-List-Utils/ListUtil.xs +++ b/cpan/Scalar-List-Utils/ListUtil.xs @@ -691,6 +691,10 @@ PPCODE: &PL_sv_undef; int count; + /* These are unused but needed for their side effects. */ + PERL_UNUSED_VAR(a); + PERL_UNUSED_VAR(b); + MULTICALL; count = PL_stack_sp - PL_stack_base; @@ -734,6 +738,10 @@ PPCODE: int count; int i; + /* These are unused but needed for their side effects. */ + PERL_UNUSED_VAR(a); + PERL_UNUSED_VAR(b); + PUSHMARK(SP); count = call_sv((SV*)cv, G_ARRAY); -- 2.1.2
On Fri Dec 05 21:56:28 2014, JHI wrote: Show quoted text
> Patch attached. I tried removing the variables but then t/pair.t > fails. Magic. > > (trying to compile core exts with -Wall -Wextra)
Compiling perl 5 blead with "gcc -Wall -Wextra" at HEAD (37e7f9c10d7c4b145b48133dcde5058d875bed7b), the only warning I get in Scalar-List-Utils is: ##### gcc -Wall -Wextra -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings -O2 -DVERSION=\"1.52\" -DXS_VERSION=\"1.52\" -fPIC "-I../.." -DPERL_EXT ListUtil.c ListUtil.xs: In function ‘XS_List__Util_sum’: ListUtil.xs:349:19: warning: this statement may fall through [-Wimplicit-fallthrough=] accum = ACC_NV; ~~~~~~^~~~~~~~ ListUtil.xs:350:9: note: here case ACC_NV: ^~~~ rm -f ../../lib/auto/List/Util/Util.so gcc -Wall -Wextra -shared -O2 -L/usr/local/lib -fstack-protector-strong ListUtil.o -o ../../lib/auto/List/Util/Util.so \ \ chmod 755 ../../lib/auto/List/Util/Util.so make[1]: Leaving directory '/home/jkeenan/gitwork/perl/cpan/Scalar-List-Utils' ##### If I understand what JHI was attempting to do, then this ticket can be closed. Thank you very much. Jim Keenan