in reply to Re: XS, pointer scope, strings, allocation responsibility, sv_setpv, SvPV, pack's pointer
in thread XS, pointer scope, strings, allocation responsibility, sv_setpv, SvPV, pack's pointer
The macro's can expand to other macro's that expand to other macro's ...:
perl-current $ ./perl -Ilib Porting/expand-macro.pl SvPVX `sh cflags "optimize='-O2 -g'" try.c` -E try.c > try.i CCCMD = ccache g++ -DPERL_CORE -c -D_REENTRANT -D_GNU_SOURC +E -fPIC -DDEBUGGING -DDEBUGGING -fno-strict-aliasing -pipe -fstack-pr +otector -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS= +64 -O2 -g -Wall -ansi -W -Wextra -Wendif-labels -Wwrite-strings -Wn +o-unused-variable -Wno-unused-parameter # 4 "SvPVX expands to" (*({ SV *const _svpvx = ((SV *)({ void *_p = (A0); _p; })); ((((svtype +)((_svpvx)->sv_flags & 0xff)) >= SVt_PV) ? static_cast<void> (0) : __ +assert_fail ("((svtype)((_svpvx)->sv_flags & 0xff)) >= SVt_PV", "SvPV +X expands to", 4, __PRETTY_FUNCTION__)); ((((svtype)((_svpvx)->sv_fla +gs & 0xff)) != SVt_PVAV) ? static_cast<void> (0) : __assert_fail ("(( +svtype)((_svpvx)->sv_flags & 0xff)) != SVt_PVAV", "SvPVX expands to", + 4, __PRETTY_FUNCTION__)); ((((svtype)((_svpvx)->sv_flags & 0xff)) != + SVt_PVHV) ? static_cast<void> (0) : __assert_fail ("((svtype)((_svpv +x)->sv_flags & 0xff)) != SVt_PVHV", "SvPVX expands to", 4, __PRETTY_F +UNCTION__)); ((!((((_svpvx)->sv_flags & (0x00004000|0x00008000)) == 0 +x00008000) && (((svtype)((_svpvx)->sv_flags & 0xff)) == SVt_PVGV || ( +(svtype)((_svpvx)->sv_flags & 0xff)) == SVt_PVLV))) ? static_cast<voi +d> (0) : __assert_fail ("!((((_svpvx)->sv_flags & (0x00004000|0x00008 +000)) == 0x00008000) && (((svtype)((_svpvx)->sv_flags & 0xff)) == SVt +_PVGV || ((svtype)((_svpvx)->sv_flags & 0xff)) == SVt_PVLV))", "SvPVX + expands to", 4, __PRETTY_FUNCTION__)); ((!(((svtype)((_svpvx)->sv_fl +ags & 0xff)) == SVt_PVIO && !(((XPVIO*) (_svpvx)->sv_any)->xio_flags +& 64))) ? static_cast<void> (0) : __assert_fail ("!(((svtype)((_svpvx +)->sv_flags & 0xff)) == SVt_PVIO && !(((XPVIO*) (_svpvx)->sv_any)->xi +o_flags & 64))", "SvPVX expands to", 4, __PRETTY_FUNCTION__)); &((_sv +pvx)->sv_u.svu_pv); }))
Sometimes that helps but sometimes it just obfuscates more then it explains
|
|---|