Skip Menu |

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

Report information
The Basics
Id: 101067
Status: resolved
Priority: 0/
Queue: List-MoreUtils

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

Bug Information
Severity: (no value)
Broken in:
  • 0.401
  • 0.33
Fixed in: 0.402



Subject: compile error: GIMME undefined in blead perl
As of commit 7143f21c482af816521c0e2affd8270cb71e7f9a ("Disallow GIMME in ext/"), List::MoreUtils doesn't compile anymore under blead perl: MoreUtils.xs: In function 'XS_List__MoreUtils_uniq': MoreUtils.xs:1570:6: error: 'GIMME' undeclared (first use in this function) This is because GIMME has been deprecated for a while and now all of its uses in core and ext/ have been removed. List::MoreUtils is also affected because it manually defines PERL_EXT in its Makefile.PL to get at cxinc: https://metacpan.org/source/REHSACK/List-MoreUtils-0.401/Makefile.PL#L126 This problem can be fixed in two ways: 1. Use GIMME_V instead of GIMME (this is the non-deprecated way to check context). 2. Only define PERL_EXT if $^V < 5.12.0 because cxinc() has been public since 5.12, so this hack is no longer needed.
On Sun Dec 21 12:58:49 2014, MAUKE wrote: Show quoted text
> As of commit 7143f21c482af816521c0e2affd8270cb71e7f9a ("Disallow GIMME > in ext/"), List::MoreUtils doesn't compile anymore under blead perl: > > MoreUtils.xs: In function 'XS_List__MoreUtils_uniq': > MoreUtils.xs:1570:6: error: 'GIMME' undeclared (first use in this > function) > > This is because GIMME has been deprecated for a while and now all of > its uses in core and ext/ have been removed. > > List::MoreUtils is also affected because it manually defines PERL_EXT > in its Makefile.PL to get at cxinc: > https://metacpan.org/source/REHSACK/List-MoreUtils- > 0.401/Makefile.PL#L126 > > This problem can be fixed in two ways: > 1. Use GIMME_V instead of GIMME (this is the non-deprecated way to > check context). > 2. Only define PERL_EXT if $^V < 5.12.0 because cxinc() has been > public since 5.12, so this hack is no longer needed.
Here is a patch that removes the use of GIMME.
Subject: open_qwWL6bJh.txt
diff -rup List-MoreUtils-0.401-sMcZjt-orig/MoreUtils.c List-MoreUtils-0.401-sMcZjt/MoreUtils.c --- List-MoreUtils-0.401-sMcZjt-orig/MoreUtils.c 2014-12-23 08:52:26.000000000 -0800 +++ List-MoreUtils-0.401-sMcZjt/MoreUtils.c 2014-12-23 09:02:07.000000000 -0800 @@ -2060,7 +2060,7 @@ XS_EUPXS(XS_List__MoreUtils_uniq) sv_2mortal(newRV_noinc((SV*)hv)); /* don't build return list in scalar context */ - if (GIMME == G_SCALAR) { + if (GIMME_V != G_ARRAY) { for (i = 0; i < items; i++) { if (!hv_exists_ent(hv, ST(i), 0)) { count++; @@ -2322,8 +2322,9 @@ XS_EUPXS(XS_List__MoreUtils_bsearch) dMULTICALL; HV *stash; GV *gv; - I32 gimme = GIMME; /* perl-5.5.4 bus-errors out later when using GIMME - therefore we save its value in a fresh variable */ + I32 gimme = GIMME_V; /* perl-5.5.4 bus-errors out later when using + GIMME therefore we save its value in a fresh + variable */ SV **args = &PL_stack_base[ax]; long i, j; @@ -2351,7 +2352,7 @@ XS_EUPXS(XS_List__MoreUtils_bsearch) if (val == 0) { POP_MULTICALL; - if (gimme == G_SCALAR) + if (gimme != G_ARRAY) XSRETURN_YES; SvREFCNT_inc(RETVAL = args[1+k]); goto yes; @@ -2372,7 +2373,7 @@ XS_EUPXS(XS_List__MoreUtils_bsearch) yes: ; } -#line 2376 "MoreUtils.c" +#line 2377 "MoreUtils.c" RETVAL = sv_2mortal(RETVAL); ST(0) = RETVAL; } @@ -2387,9 +2388,9 @@ XS_EUPXS(XS_List__MoreUtils__XScompiled) if (items != 0) croak_xs_usage(cv, ""); { -#line 1848 "MoreUtils.xs" +#line 1849 "MoreUtils.xs" XSRETURN_YES; -#line 2393 "MoreUtils.c" +#line 2394 "MoreUtils.c" } XSRETURN_EMPTY; } @@ -2471,7 +2472,7 @@ XS_EXTERNAL(boot_List__MoreUtils) #endif #if XSubPPtmpAAAB #endif -#line 2475 "MoreUtils.c" +#line 2476 "MoreUtils.c" /* End of Initialisation Section */ Only in List-MoreUtils-0.401-sMcZjt: MoreUtils.o diff -rup List-MoreUtils-0.401-sMcZjt-orig/MoreUtils.xs List-MoreUtils-0.401-sMcZjt/MoreUtils.xs --- List-MoreUtils-0.401-sMcZjt-orig/MoreUtils.xs 2014-12-03 06:16:50.000000000 -0800 +++ List-MoreUtils-0.401-sMcZjt/MoreUtils.xs 2014-12-23 09:02:04.000000000 -0800 @@ -1567,7 +1567,7 @@ uniq (...) sv_2mortal(newRV_noinc((SV*)hv)); /* don't build return list in scalar context */ - if (GIMME == G_SCALAR) { + if (GIMME_V != G_ARRAY) { for (i = 0; i < items; i++) { if (!hv_exists_ent(hv, ST(i), 0)) { count++; @@ -1789,8 +1789,9 @@ CODE: dMULTICALL; HV *stash; GV *gv; - I32 gimme = GIMME; /* perl-5.5.4 bus-errors out later when using GIMME - therefore we save its value in a fresh variable */ + I32 gimme = GIMME_V; /* perl-5.5.4 bus-errors out later when using + GIMME therefore we save its value in a fresh + variable */ SV **args = &PL_stack_base[ax]; long i, j; @@ -1818,7 +1819,7 @@ CODE: if (val == 0) { POP_MULTICALL; - if (gimme == G_SCALAR) + if (gimme != G_ARRAY) XSRETURN_YES; SvREFCNT_inc(RETVAL = args[1+k]); goto yes; Only in List-MoreUtils-0.401-sMcZjt/blib/arch/auto/List/MoreUtils: MoreUtils.bundle Only in List-MoreUtils-0.401-sMcZjt/blib/man3: List::MoreUtils.3 Only in List-MoreUtils-0.401-sMcZjt/blib/man3: List::MoreUtils::PP.3 Only in List-MoreUtils-0.401-sMcZjt/blib/man3: List::MoreUtils::XS.3
On Tue Dec 23 12:03:59 2014, SPROUT wrote: Show quoted text
> On Sun Dec 21 12:58:49 2014, MAUKE wrote:
> > As of commit 7143f21c482af816521c0e2affd8270cb71e7f9a ("Disallow GIMME > > in ext/"), List::MoreUtils doesn't compile anymore under blead perl: > > > > MoreUtils.xs: In function 'XS_List__MoreUtils_uniq': > > MoreUtils.xs:1570:6: error: 'GIMME' undeclared (first use in this > > function) > > > > This is because GIMME has been deprecated for a while and now all of > > its uses in core and ext/ have been removed. > > > > List::MoreUtils is also affected because it manually defines PERL_EXT > > in its Makefile.PL to get at cxinc: > > https://metacpan.org/source/REHSACK/List-MoreUtils- > > 0.401/Makefile.PL#L126 > > > > This problem can be fixed in two ways: > > 1. Use GIMME_V instead of GIMME (this is the non-deprecated way to > > check context). > > 2. Only define PERL_EXT if $^V < 5.12.0 because cxinc() has been > > public since 5.12, so this hack is no longer needed.
> > Here is a patch that removes the use of GIMME.
Sorry; that was a bit messy. I did a diff of the entire folder and failed to remove the .c patch. Try this one.
Subject: new-patch.txt
diff -rup List-MoreUtils-0.401-sMcZjt-orig/MoreUtils.xs List-MoreUtils-0.401-sMcZjt/MoreUtils.xs --- List-MoreUtils-0.401-sMcZjt-orig/MoreUtils.xs 2014-12-03 06:16:50.000000000 -0800 +++ List-MoreUtils-0.401-sMcZjt/MoreUtils.xs 2014-12-23 09:02:04.000000000 -0800 @@ -1567,7 +1567,7 @@ uniq (...) sv_2mortal(newRV_noinc((SV*)hv)); /* don't build return list in scalar context */ - if (GIMME == G_SCALAR) { + if (GIMME_V != G_ARRAY) { for (i = 0; i < items; i++) { if (!hv_exists_ent(hv, ST(i), 0)) { count++; @@ -1789,8 +1789,9 @@ CODE: dMULTICALL; HV *stash; GV *gv; - I32 gimme = GIMME; /* perl-5.5.4 bus-errors out later when using GIMME - therefore we save its value in a fresh variable */ + I32 gimme = GIMME_V; /* perl-5.5.4 bus-errors out later when using + GIMME therefore we save its value in a fresh + variable */ SV **args = &PL_stack_base[ax]; long i, j; @@ -1818,7 +1819,7 @@ CODE: if (val == 0) { POP_MULTICALL; - if (gimme == G_SCALAR) + if (gimme != G_ARRAY) XSRETURN_YES; SvREFCNT_inc(RETVAL = args[1+k]); goto yes;
On Tue Dec 23 12:28:57 2014, SPROUT wrote: Show quoted text
> On Tue Dec 23 12:03:59 2014, SPROUT wrote:
[...] Show quoted text
> Sorry; that was a bit messy. I did a diff of the entire folder and > failed to remove the .c patch. Try this one.
No worries - I care of it after Christmas. I evaluate Lukas hints first. Cheers, Jens