develooper Front page | perl.perl5.porters | Postings from December 2017

Re: [perl #132545] Double macro argument evaluation inS_init_main_stash

Thread Previous | Thread Next
From:
Zefram
Date:
December 10, 2017 19:09
Subject:
Re: [perl #132545] Double macro argument evaluation inS_init_main_stash
Message ID:
20171210190928.GC25404@fysh.org
Hugo van der Sanden via RT wrote:
>Is there also some portable way to fix the double-evaluation of the
>macro, or can we use some naming convention to call out the macros that
>will do multiple evaluation?

We do the latter, to some extent.  The SvREFCNT_inc() macros with
"_simple" in their name are permitted to double evaluate: the "_simple"
indicates that the caller guarantees that the argument is simple enough.
So another way to fix this particular bug would have been to drop the
"_simple".  With some other macros we have the convention of an "x"
suffix to indicate that the macro will not double evaluate: for example,
SvIVx() as the single-evaluation version of SvIV().

>Are we at the point where our target set of compilers can all handle
>inline functions, for example?

They can all handle static functions, which is close enough.

-zefram

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About