0

I can not get Perl/Tk to install via CPAN on OS X Mountain Lion. It errors with an error in a file with which google does not help:

/Users/villadelfia/perl5/perlbrew/perls/perl-5.17.8/bin/perl5.17.8 /Users/villadelfia/perl5/perlbrew/perls/perl-5.17.8/lib/5.17.8/ExtUtils/xsubpp  -typemap /Users/villadelfia/perl5/perlbrew/perls/perl-5.17.8/lib/5.17.8/ExtUtils/typemap -typemap /Users/villadelfia/Downloads/Tk-804.030/Tk/typemap  IO.xs > IO.xsc && mv IO.xsc IO.c
Warning: Found a 'CODE' section which seems to be using 'RETVAL' but no 'OUTPUT' section. in IO.xs, line 235
cc -c  -I.. -I/usr/X11R6/include -I/usr/local/include/freetype2 -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O3   -DVERSION=\"804.03\" -DXS_VERSION=\"804.03\"  "-I/Users/villadelfia/perl5/perlbrew/perls/perl-5.17.8/lib/5.17.8/darwin-2level/CORE"   -Wall -Wno-implicit-int -Wno-comment -Wno-unused -D__USE_FIXED_PROTOTYPES__ IO.c
IO.xs:210:10: error: invalid argument type 'void' to unary expression
     if (!SvUPGRADE(buf, SVt_PV))
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [IO.o] Error 1
make: *** [subdirs] Error 2

As you can see, I run perlbrew as well.

Any ideas what could cause this?

1 Answers1

0

From the 5.17.7 release notes:

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.

So this is now a syntax error:

if (!SvUPGRADE(sv)) { croak(...); }

If you have code like that, simply replace it with

SvUPGRADE(sv);

or to to avoid compiler warnings with older perls, possibly

(void)SvUPGRADE(sv);

It has already been reported.

ikegami
  • 367,544
  • 15
  • 269
  • 518