develooper Front page | perl.perl5.porters | Postings from May 2001

Re: [PATCH pp_sys.c] More warnings

Thread Previous | Thread Next
From:
Graham Barr
Date:
May 30, 2001 09:55
Subject:
Re: [PATCH pp_sys.c] More warnings
Message ID:
20010530175221.N464@pobox.com
On Wed, May 30, 2001 at 03:56:13PM +0100, Hugo wrote:
> In <20010530143239.567.18@dromedary.ni-s.u-net.com>, Nick Ing-Simmons writes:
> :>PS  What's the difference between SvPV and SvPVx?
> :
> :Read the source (i.e. sv.h) ...
> :
> :SvPVx makes a copy of the SV * so that 
> :
> :SvPVx(*p++,len) is "okay"
> :whereas 
> :SvPV(*p++,len) isn't as the macro may do multiple ++s.
> 
> But SvPV doesn't actually use the argument multiple times.

Yes it does if CRIPPLED_CC is not defined

sv.h:894

#define SvPV(sv, lp) \
    ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
     ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv(sv, &lp))

Graham.

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