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 (Canon) 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 (Archbishop) 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.

    Cheers,
    Rob