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


In reply to redefinition of av in CX_POP_SAVEARRAY perl 5.24 by ptizoom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.