Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

redefinition of av in CX_POP_SAVEARRAY perl 5.24

by ptizoom (Scribe)
on Dec 01, 2016 at 09:42 UTC ( [id://1177029]=perlquestion: print w/replies, xml ) Need Help??

ptizoom has asked for the wisdom of the Perl Monks concerning the following question:

now perl5.24 headers are really flaky.... I ended up with this error upgrading "my "perl ....
... In file included from /usr/lib/x86_64-linux-gnu/perl/5.24/CORE/perl.h: +3905:0, from /home/christian/prj/ai/freeciv/dependencies/free +civ/client/gui-swig/fc_swig_perl_side.h:53, from /home/christian/prj/ai/freeciv/dependencies/free +civ/client/gui-swig/fc_swig_cside.c:36: /usr/lib/x86_64-linux-gnu/perl/5.24/CORE/inline.h: Dans la fonction « + S_cx_popsub_args »: /usr/lib/x86_64-linux-gnu/perl/5.24/CORE/cop.h:612:13: erreur : decla +ration of « av » shadows a previous local [-Werror=shadow] AV *av = GvAV(PL_defgv); + \ ^ /usr/lib/x86_64-linux-gnu/perl/5.24/CORE/cop.h:612:13: note : in defi +nition of macro « CX_POP_SAVEARRAY » AV *av = GvAV(PL_defgv); + \ ^~ In file included from /usr/lib/x86_64-linux-gnu/perl/5.24/CORE/perl.h: +5859:0, from /home/christian/prj/ai/freeciv/dependencies/free +civ/client/gui-swig/fc_swig_perl_side.h:53, from /home/christian/prj/ai/freeciv/dependencies/free +civ/client/gui-swig/fc_swig_cside.c:36: /usr/lib/x86_64-linux-gnu/perl/5.24/CORE/inline.h:518:9: note : shado +wed declaration is here AV *av; ...

this does not happen when compiling C++ objects, (see header used below) but just in C. so , I prepend perl.h include with

#define PERL_NO_INLINE_FUNCTIONS 1
and all is back to normal ...

so, which monk needs to be excommunicated ?!

here is the header I now use ...
//.... #ifdef __cplusplus #include <math.h> #include <stdlib.h> extern "C" { #endif #ifndef __cplusplus #define PERL_NO_INLINE_FUNCTIONS 1 #endif #include "EXTERN.h" #if defined _ #undef _ #endif #include "perl.h" #include "XSUB.h" #include <string.h> #ifdef __cplusplus } #endif

by the way #define PERL_NO_INLINE_FUNCTIONS 1 will also not work alone: we would be forced to make an use of S_croak_memory_wrap(),

PERL_STATIC_NO_RET void S_croak_memory_wrap(void) {Perl_croak_nocontex +t("panic: memory wrap");}
and loose important inline macro... like....S_SvREFCNT_inc()...

Replies are listed 'Best First'.
Re: redefinition of av in CX_POP_SAVEARRAY perl 5.24
by dave_the_m (Monsignor) on Dec 01, 2016 at 10:20 UTC
    AFAIKT you are building your perl in two non-standard ways which together are causing the build failure. First you are enabling the -Wshadow warning, which isn't enabled by default; second you are upgrading this (or possibly all) compile warnings into fatal errors with -Werror.

    Undo either of those changes and perl will build.

    Dave.

      ah,,,I realise I go out of the path, and do not follow the Shepard ways, but is that what a sheep should seek for, a life rewarded with lots of grassy adventures?

      here this is a compilation for bridging C++, C objects with swig 3 - perl and this way surected in this 5.24 version.

      so I thought if the sheep does not come to the Shepard, then the Shepard has to come to the sheep.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1177029]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-24 12:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found