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

Re: [PATCH pp_sys.c] More warnings

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
May 30, 2001 12:13
Subject:
Re: [PATCH pp_sys.c] More warnings
Message ID:
20010530191228.567.28@dromedary.ni-s.u-net.com
Hugo <hv@crypt0.demon.co.uk> writes:
>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.

#define SvPV(sv, lp) SvPV_flags(sv, lp, SV_GMAGIC)

#define SvPV_flags(sv, lp, flags) \
    ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
              ^^ 1 
     ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
                    ^^ 2        ^^3                 ^^4

Looks like more than one to me ...




>
>Hugo
-- 
Nick Ing-Simmons
who is looking for a new job see http://www.ni-s.u-net.com/


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