Package: perl-tk
Version: 1:804.030-1
Severity: important
Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=82677
Tags: upstream
User: debian-p...@lists.debian.org
Usertags: perl-5.18-transition
After fixing #708624, this package fails to build with perl 5.18.0-RC1
from experimental:
cc -c -I.. -I/usr/include/freetype2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN
-fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\804.03\
-DXS_VERSION=\804.03\ -fPIC -I/usr/lib/perl/5.18/CORE -Wall
-Wno-implicit-int -Wno-comment -Wno-unused -D__USE_FIXED_PROTOTYPES__ IO.c
IO.xs: In function 'XS_Tk__IO_read':
IO.xs:210:6: error: invalid use of void expression
make[2]: *** [IO.o] Error 1
make[2]: Leaving directory `/home/niko/tmp/perl-tk-804.030/IO'
make[1]: *** [subdirs] Error 2
make[1]: Leaving directory `/home/niko/tmp/perl-tk-804.030'
make: *** [build-stamp] Error 2
From the 5.18 perldelta.pod:
SvUPGRADE() is no longer an expression. Originally this macro (and
its underlying function, sv_upgrade()) were documented as boolean,
although in reality they always croaked on error and never returned
false. In 2005 the documentation was updated to specify a void return
value, but SvUPGRADE() was left always returning 1 for backwards
compatibility. This has now been removed, and SvUPGRADE() is now a
statement with no return value.
This is easily fixed by the attached patch, but then we see:
cc -c -I/usr/include/freetype2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN
-fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\804.03\
-DXS_VERSION=\804.03\ -fPIC -I/usr/lib/perl/5.18/CORE -Wall
-Wno-implicit-int -Wno-comment -Wno-unused -D__USE_FIXED_PROTOTYPES__ tkGlue.c
tkGlue.c: In function 'LangSaveVar':
tkGlue.c:4195:26: error: lvalue required as left operand of assignment
tkGlue.c: In function 'XEvent_Info':
tkGlue.c:5023:9: warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
tkGlue.c: In function 'install_vtab':
tkGlue.c:5513:6: warning: format '%d' expects argument of type 'int', but
argument 3 has type 'size_t' [-Wformat]
make[1]: *** [tkGlue.o] Error 1
which I don't have fix for ATM. FWIW, the code around tkGlue.c:4195 is
#ifdef USE_ITHREADS
CopSTASHPV(PL_curcop) = NULL;
#else
CopSTASH(PL_curcop) = NULL;
#endif
--
Niko Tyni nt...@debian.org
From 1c62e2862c2ca72f21b9bb0e78f6d565d321d866 Mon Sep 17 00:00:00 2001
From: Niko Tyni nt...@debian.org
Date: Fri, 17 May 2013 11:28:47 +0300
Subject: [PATCH] SvUPGRADE return value hasn't meant anything for years
Quoting Perl 5.18 release notes (perldelta.pod):
SvUPGRADE() is no longer an expression. Originally this macro (and its
underlying function, sv_upgrade()) were documented as boolean, although in
reality they always croaked on error and never returned false. In 2005 the
documentation was updated to specify a void return value, but SvUPGRADE()
was left always returning 1 for backwards compatibility. This has now
been removed, and SvUPGRADE() is now a statement with no return value.
---
IO/IO.xs |6 +-
tkGlue.c |5 +
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/IO/IO.xs b/IO/IO.xs
index 8ae2a57..9eb7823 100644
--- a/IO/IO.xs
+++ b/IO/IO.xs
@@ -207,11 +207,7 @@ int offset
info.count = 0;
info.error = 0;
info.eof= 0;
- if (!SvUPGRADE(buf, SVt_PV))
- {
- RETVAL = PL_sv_undef;
- return;
- }
+ (void) SvUPGRADE(buf, SVt_PV);
SvPOK_only(buf); /* validate pointer */
Tcl_CreateFileHandler(fd, TCL_READABLE, read_handler, (ClientData) info);
do
diff --git a/tkGlue.c b/tkGlue.c
index dd3d283..443ba46 100644
--- a/tkGlue.c
+++ b/tkGlue.c
@@ -3830,10 +3830,7 @@ ClientData clientData;
return EXPIRE((interp, Cannot trace readonly variable));
}
}
- if (!SvUPGRADE(sv, SVt_PVMG))
- {
- return EXPIRE((interp, Trace SvUPGRADE failed));
- }
+ (void) SvUPGRADE(sv, SVt_PVMG);
if (SvTYPE(sv) == SVt_PVAV)
{
--
1.7.10.4