Skip Menu |

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

Report information
The Basics
Id: 87538
Status: resolved
Priority: 0/
Queue: Scalar-List-Utils

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

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



Subject: 1.29 fails to build on MSWin32 with MSVC compiler
This is currently causing smoke failures in bleadperl: http://www.nntp.perl.org/group/perl.daily-build.reports/2013/08/msg147481.html CPAN.pm: Building P/PE/PEVANS/Scalar-List-Utils-1.29.tar.gz CPAN::Reporter not installed. No reports will be sent. Checking if your kit is complete... Looks good Writing Makefile for List::Util Writing MYMETA.yml and MYMETA.json Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. cp lib/List/Util.pm blib\lib\List\Util.pm cp lib/Scalar/Util.pm blib\lib\Scalar\Util.pm cp lib/List/Util/XS.pm blib\lib\List\Util\XS.pm C:\testperl\bin\perl.exe C:\testperl\lib\ExtUtils\xsubpp -typemap C:\te stperl\lib\ExtUtils\typemap ListUtil.xs > ListUtil.xsc && C:\testperl\bin\perl. exe -MExtUtils::Command -e mv -- ListUtil.xsc ListUtil.c cl -c -nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -fp:precise -DWIN32 -D _CONSOLE -DNO_STRICT -DWIN64 -DCONSERVATIVE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NO NSTDC_NO_DEPRECATE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLIC IT_SYS -DUSE_PERLIO -O1 -MD -Zi -DNDEBUG -GL -fp:precise -DVERSION=\"1.29\" -DXS_VERSION=\"1.29\" "-IC:\testperl\lib\CORE" -DPERL_EXT ListUtil.c ListUtil.c c:\testperl\lib\core\hv_func.h(260) : warning C4267: 'initializing' : conversion from 'size_t' to 'U32', possible loss of data c:\testperl\lib\core\hv_func.h(370) : warning C4267: 'initializing' : conversion from 'size_t' to 'I32', possible loss of data c:\testperl\lib\core\hv_func.h(393) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data c:\testperl\lib\core\hv_func.h(434) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data c:\testperl\lib\core\hv_func.h(484) : warning C4267: 'initializing' : conversion from 'size_t' to 'U32', possible loss of data c:\testperl\lib\core\hv_func.h(499) : warning C4267: 'initializing' : conversion from 'size_t' to 'U32', possible loss of data c:\testperl\lib\core\inline.h(23) : warning C4244: 'return' : conversion from '_ _int64' to 'I32', possible loss of data ListUtil.xs(253) : warning C4244: '=' : conversion from '__int64' to 'I32', poss ible loss of data ListUtil.xs(253) : warning C4244: '=' : conversion from '__int64' to 'I32', poss ible loss of data ListUtil.xs(305) : warning C4244: '=' : conversion from '__int64' to 'I32', poss ible loss of data ListUtil.xs(305) : warning C4244: '=' : conversion from '__int64' to 'I32', poss ible loss of data ListUtil.xs(421) : error C2143: syntax error : missing ';' before 'type' ListUtil.xs(425) : error C2065: 'count' : undeclared identifier ListUtil.xs(444) : error C2143: syntax error : missing ';' before 'type' ListUtil.xs(445) : error C2065: 'i' : undeclared identifier ListUtil.xs(445) : error C2065: 'i' : undeclared identifier ListUtil.xs(445) : error C2065: 'count' : undeclared identifier ListUtil.xs(445) : error C2065: 'i' : undeclared identifier ListUtil.xs(446) : error C2065: 'i' : undeclared identifier ListUtil.xs(446) : error C2065: 'count' : undeclared identifier NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\ VC\Bin\amd64\cl.EXE"' : return code '0x2' Stop. PEVANS/Scalar-List-Utils-1.29.tar.gz nmake -- NOT OK 'YAML' not installed, will not store persistent state Running make test Can't test without successful make Stopping: 'test' failed for 'Scalar::Util'. The attached patch fixes the problem, also available as a pull request: https://github.com/Scalar-List-Utils/Scalar-List-Utils/pull/5 Tony
Subject: 0001-MSVC-is-C89-and-doesn-t-allow-mixed-declarations-and.patch
From 5a7ded498f4382939c17133fc2ed061011b76697 Mon Sep 17 00:00:00 2001 From: Tony Cook <tony@develop-help.com> Date: Fri, 2 Aug 2013 10:27:57 +1000 Subject: [PATCH] MSVC is C89 and doesn't allow mixed declarations and statements --- ListUtil.xs | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ListUtil.xs b/ListUtil.xs index d2f2f11..7cb16e7 100644 --- a/ListUtil.xs +++ b/ListUtil.xs @@ -416,9 +416,11 @@ PPCODE: SV *b = GvSV(bgv) = argi < items-1 ? (args_copy ? args_copy[argi+1] : ST(argi+1)) : &PL_sv_undef; + int count; + int i; PUSHMARK(SP); - int count = call_sv((SV*)cv, G_ARRAY); + count = call_sv((SV*)cv, G_ARRAY); SPAGAIN; @@ -441,7 +443,6 @@ PPCODE: items = n_args; } - int i; for(i = 0; i < count; i++) ST(reti++) = sv_mortalcopy(SP[i - count + 1]); -- 1.7.3.1.msysgit.0
On Thu Aug 01 20:30:59 2013, TONYC wrote: Show quoted text
> The attached patch fixes the problem, also available as a pull > request: > > https://github.com/Scalar-List-Utils/Scalar-List-Utils/pull/5
Oh yes. Weird that none of the smokers picked up on this during testing though: http://matrix.cpantesters.org/?dist=Scalar-List-Utils%201.27_002;os=mswin32;reports=1 I did specifically wait for some MSWin32 PASS results before I released it. -- Paul Evans
CC: TONYC [...] cpan.org
Subject: Re: [rt.cpan.org #87538] 1.29 fails to build on MSWin32 with MSVC compiler
Date: Sat, 3 Aug 2013 09:11:56 +1000
To: Paul Evans via RT <bug-Scalar-List-Utils [...] rt.cpan.org>
From: Tony Cook <tony [...] develop-help.com>
On Fri, Aug 02, 2013 at 07:46:23AM -0400, Paul Evans via RT wrote: Show quoted text
> Weird that none of the smokers picked up on this during testing though: > > http://matrix.cpantesters.org/?dist=Scalar-List-Utils%201.27_002;os=mswin32;reports=1 > > I did specifically wait for some MSWin32 PASS results before I released it.
None of them use MSVC. If you want a simple pre-release check, you can test for this problem locally with GCC by running: perl Makefile.PL OPTIMIZE=-Werror=declaration-after-statement make ListUtil.xs: In function ‘XS_List__Util_pairmap’: ListUtil.xs:421:6: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] ListUtil.xs:444:6: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] cc1: some warnings being treated as errors Tony
On Fri Aug 02 19:12:18 2013, tony@develop-help.com wrote: Show quoted text
> If you want a simple pre-release check, you can test for this problem > locally with GCC by running: > > perl Makefile.PL OPTIMIZE=-Werror=declaration-after-statement > make > > ListUtil.xs: In function ‘XS_List__Util_pairmap’: > ListUtil.xs:421:6: error: ISO C90 forbids mixed declarations and code > [-Werror=declaration-after-statement] > ListUtil.xs:444:6: error: ISO C90 forbids mixed declarations and code > [-Werror=declaration-after-statement] > cc1: some warnings being treated as errors >
Could that warning be added to the core perl compile flags when building with gcc? It would be a really useful thing for everyone (using gcc) to always have enabled because the problem of code before declarations too often trips up the Windows/MSVC build (and a few other OSes/compilers too).
On Thu Aug 01 20:30:59 2013, TONYC wrote: Show quoted text
> This is currently causing smoke failures in bleadperl: > > http://www.nntp.perl.org/group/perl.daily- > build.reports/2013/08/msg147481.html > > CPAN.pm: Building P/PE/PEVANS/Scalar-List-Utils-1.29.tar.gz > > CPAN::Reporter not installed. No reports will be sent. > Checking if your kit is complete... > Looks good > Writing Makefile for List::Util > Writing MYMETA.yml and MYMETA.json > > Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 > Copyright (C) Microsoft Corporation. All rights reserved. > > cp lib/List/Util.pm blib\lib\List\Util.pm > cp lib/Scalar/Util.pm blib\lib\Scalar\Util.pm > cp lib/List/Util/XS.pm blib\lib\List\Util\XS.pm > C:\testperl\bin\perl.exe C:\testperl\lib\ExtUtils\xsubpp > -typemap C:\te > stperl\lib\ExtUtils\typemap ListUtil.xs > ListUtil.xsc && > C:\testperl\bin\perl. > exe -MExtUtils::Command -e mv -- ListUtil.xsc ListUtil.c > cl -c -nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -fp:precise > -DWIN32 -D > _CONSOLE -DNO_STRICT -DWIN64 -DCONSERVATIVE -D_CRT_SECURE_NO_DEPRECATE > -D_CRT_NO > NSTDC_NO_DEPRECATE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT > -DPERL_IMPLIC > IT_SYS -DUSE_PERLIO -O1 -MD -Zi -DNDEBUG -GL -fp:precise > -DVERSION=\"1.29\" > -DXS_VERSION=\"1.29\" "-IC:\testperl\lib\CORE" -DPERL_EXT ListUtil.c > ListUtil.c > c:\testperl\lib\core\hv_func.h(260) : warning C4267: 'initializing' : > conversion > from 'size_t' to 'U32', possible loss of data > c:\testperl\lib\core\hv_func.h(370) : warning C4267: 'initializing' : > conversion > from 'size_t' to 'I32', possible loss of data > c:\testperl\lib\core\hv_func.h(393) : warning C4267: 'initializing' : > conversion > from 'size_t' to 'int', possible loss of data > c:\testperl\lib\core\hv_func.h(434) : warning C4267: 'initializing' : > conversion > from 'size_t' to 'int', possible loss of data > c:\testperl\lib\core\hv_func.h(484) : warning C4267: 'initializing' : > conversion > from 'size_t' to 'U32', possible loss of data > c:\testperl\lib\core\hv_func.h(499) : warning C4267: 'initializing' : > conversion > from 'size_t' to 'U32', possible loss of data > c:\testperl\lib\core\inline.h(23) : warning C4244: 'return' : > conversion from '_ > _int64' to 'I32', possible loss of data > ListUtil.xs(253) : warning C4244: '=' : conversion from '__int64' to > 'I32', poss > ible loss of data > ListUtil.xs(253) : warning C4244: '=' : conversion from '__int64' to > 'I32', poss > ible loss of data > ListUtil.xs(305) : warning C4244: '=' : conversion from '__int64' to > 'I32', poss > ible loss of data > ListUtil.xs(305) : warning C4244: '=' : conversion from '__int64' to > 'I32', poss > ible loss of data > ListUtil.xs(421) : error C2143: syntax error : missing ';' before > 'type' > ListUtil.xs(425) : error C2065: 'count' : undeclared identifier > ListUtil.xs(444) : error C2143: syntax error : missing ';' before > 'type' > ListUtil.xs(445) : error C2065: 'i' : undeclared identifier > ListUtil.xs(445) : error C2065: 'i' : undeclared identifier > ListUtil.xs(445) : error C2065: 'count' : undeclared identifier > ListUtil.xs(445) : error C2065: 'i' : undeclared identifier > ListUtil.xs(446) : error C2065: 'i' : undeclared identifier > ListUtil.xs(446) : error C2065: 'count' : undeclared identifier > NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual > Studio 9.0\ > VC\Bin\amd64\cl.EXE"' : return code '0x2' > Stop. > PEVANS/Scalar-List-Utils-1.29.tar.gz > nmake -- NOT OK > 'YAML' not installed, will not store persistent state > Running make test > Can't test without successful make > Stopping: 'test' failed for 'Scalar::Util'. > > The attached patch fixes the problem, also available as a pull > request: > > https://github.com/Scalar-List-Utils/Scalar-List-Utils/pull/5 > > Tony
Should now be fixed in 1.29_001: https://metacpan.org/release/PEVANS/Scalar-List-Utils-1.29_001 I've also added MULTICALL implementations of the new pair{map,grep} and also added a pairfirst, so I'll leave this one on devel for now. If you let me know if that one works on MSVC, I'll call it 1.30. (I also tested it with the GCC warning suggested; and that seems to pass fine) -- Paul Evans
CC: TONYC [...] cpan.org
Subject: Re: [rt.cpan.org #87538] 1.29 fails to build on MSWin32 with MSVC compiler
Date: Mon, 5 Aug 2013 10:21:17 +1000
To: Paul Evans via RT <bug-Scalar-List-Utils [...] rt.cpan.org>
From: Tony Cook <tony [...] develop-help.com>
On Sun, Aug 04, 2013 at 01:45:45PM -0400, Paul Evans via RT wrote: Show quoted text
> > Should now be fixed in 1.29_001: > > https://metacpan.org/release/PEVANS/Scalar-List-Utils-1.29_001
Thanks. Show quoted text
> I've also added MULTICALL implementations of the new pair{map,grep} and also added a pairfirst, so I'll leave this one on devel for now. > > If you let me know if that one works on MSVC, I'll call it 1.30. > > (I also tested it with the GCC warning suggested; and that seems to pass fine)
All tests pass, though perl warns a bit: t/00version.t ......... ok t/blessed.t ........... ok t/dualvar.t ........... ok t/first.t ............. ok t/getmagic-once.t ..... ok t/isvstring.t ......... ok t/lln.t ............... ok t/max.t ............... overload arg '+0' is invalid at t/max.t line 55. t/max.t ............... ok t/maxstr.t ............ ok t/min.t ............... overload arg '+0' is invalid at t/min.t line 54. t/min.t ............... ok t/minstr.t ............ ok t/openhan.t ........... ok t/pair.t .............. ok t/proto.t ............. ok t/readonly.t .......... ok t/reduce.t ............ ok t/refaddr.t ........... overload arg '"' is invalid at t/refaddr.t line 76. t/refaddr.t ........... ok t/reftype.t ........... ok t/shuffle.t ........... ok t/stack-corruption.t .. ok t/sum.t ............... overload arg '+0' is invalid at t/sum.t line 53. t/sum.t ............... ok t/sum0.t .............. ok t/tainted.t ........... ok t/weak.t .............. ok All tests successful. Files=24, Tests=343, 3 wallclock secs ( 0.19 usr + 0.01 sys = 0.20 CPU) Result: PASS
CC: TONYC [...] cpan.org
Subject: Re: [rt.cpan.org #87538] 1.29 fails to build on MSWin32 with MSVC compiler
Date: Mon, 5 Aug 2013 10:26:38 +1000
To: Steve Hay via RT <bug-Scalar-List-Utils [...] rt.cpan.org>
From: Tony Cook <tony [...] develop-help.com>
On Sat, Aug 03, 2013 at 07:56:11AM -0400, Steve Hay via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=87538 > > > On Fri Aug 02 19:12:18 2013, tony@develop-help.com wrote:
> > If you want a simple pre-release check, you can test for this problem > > locally with GCC by running: > > > > perl Makefile.PL OPTIMIZE=-Werror=declaration-after-statement > > make > > > > ListUtil.xs: In function ‘XS_List__Util_pairmap’: > > ListUtil.xs:421:6: error: ISO C90 forbids mixed declarations and code > > [-Werror=declaration-after-statement] > > ListUtil.xs:444:6: error: ISO C90 forbids mixed declarations and code > > [-Werror=declaration-after-statement] > > cc1: some warnings being treated as errors > >
> > Could that warning be added to the core perl compile flags when building with gcc? It would be a really useful thing for everyone (using gcc) to always have enabled because the problem of code before declarations too often trips up the Windows/MSVC build (and a few other OSes/compilers too).
I could add it to a smoker. I don't think it's appropriate to make it a hard error for general use - restricting the dialect of C for eg. Linux specific XS modules to that supported by a seriously out of date platform specific compiler would be unfair. That said, you're a committer :) Tony
Released as 1.30 -- Paul Evans