Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Issue with CPAN module not building

by zbuser (Initiate)
on Aug 01, 2013 at 15:57 UTC ( #1047480=perlquestion: print w/replies, xml ) Need Help??
zbuser has asked for the wisdom of the Perl Monks concerning the following question:

I have run into an issue attempting to build the CPAN module Newt-1.08. The Newt.xs/Newt.c module fails compilation. A project I have been trying to port uses Newt.

The system is running Redhat EL6, the compiler is gcc 4.4.7. Here is the relevant error message:

gcc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack +-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BI +TS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack +-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION= +\"1.08\" -DXS_VERSION=\"1.08\" -fPIC "-I/usr/lib64/perl5/CORE" Newt +.c Newt.xs: In function ‚constant‚: Newt.xs:99: warning: ‚return‚ with no value, in function returning non +-void Newt.xs:658: warning: label ‚not_there‚ defined but not used Newt.c: In function ‚XS_Newt_va_end‚: Newt.c:765: error: cast specifies array type Newt.c: In function ‚XS_Newt_newtFormRun‚: Newt.xs:1041: warning: unused variable ‚sv‚ Newt.c: In function ‚XS_Newt_newtButtonBarv‚: Newt.c:3442: error: cast specifies array type Newt.c: In function ‚XS_Newt_newtWinMessagev‚: Newt.c:3528: error: cast specifies array type make: *** [Newt.o] Error 1

The portion of the Newt.c program relevant to the first error at line 765 is (actual error is set off with dashes):

XS(XS_Newt_va_end); /* prototype to pass -Wmissing-prototypes */ XS(XS_Newt_va_end) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "arg0"); { __gnuc_va_list arg0; -------------------------- if (sv_derived_from(ST(0), "__gnuc_va_list")) { IV tmp = SvIV((SV*)SvRV(ST(0))); arg0 = INT2PTR(__gnuc_va_list,tmp); -------------------------- } else Perl_croak(aTHX_ "%s: %s is not of type %s", "Newt::va_end", "arg0", "__gnuc_va_list"); va_end(arg0); } XSRETURN_EMPTY; }

So how did this compile in the first place? I am just not seeing what I'm doing wrong.

Replies are listed 'Best First'.
Re: Issue with CPAN module not building
by tobyink (Abbot) on Aug 01, 2013 at 16:55 UTC

    I'm not especially surprised. Newt hasn't seen a release in almost 15 years. Back then, Perl 5.5 was still the current stable version of Perl. Modern Perls have had API changes since then, so there would probably be problems linking them; also gcc has come a long way since then and that may cause problems too.

    There's only a single PASS result on CPAN testers, so you're not the only person that has had problems.

    If you can track down a machine running Perl 5.6/5.8 and gcc 2.9x, then you might have better luck building it.

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
Re: Issue with CPAN module not building
by syphilis (Chancellor) on Aug 02, 2013 at 00:00 UTC
    Is it the cast to SV* that's causing the error ?
    If so, I'd try removing it and see what happens.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1047480]
Approved by ww
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2017-12-17 22:35 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (466 votes). Check out past polls.