ptizoom has asked for the wisdom of the Perl Monks concerning the following question:
... 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
and all is back to normal ...#define PERL_NO_INLINE_FUNCTIONS 1
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(),
and loose important inline macro... like....S_SvREFCNT_inc()...PERL_STATIC_NO_RET void S_croak_memory_wrap(void) {Perl_croak_nocontex +t("panic: memory wrap");}
|
|---|
| 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 | |
by ptizoom (Scribe) on Dec 10, 2016 at 08:49 UTC |