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