Tassilo Parseval <[EMAIL PROTECTED]> writes: >> The risk is if what you show as '...' can croak() - then perhaps something to >> restore the SV would be appropriate. > >That fortunately can't happen in this particular case. But om the >future, I might need something more generic, so... > >> As this is an SV there is an save_item() to do the job (I think - I >> always have to read scope.c for the save_xxx() stuff). > >A > > save_item(PL_curcops->cop_warnings); > PL_curcops->cop_warnings = pPWARN_NONE; > >would automatically restore PL_curcops->cop_warnings upon leaving the >XSUB? That would be pretty cool.
With the save_xxx() stuff it I always have to look at code but yes, that will restore it on next LEAVE; Calling an XS does not normally give you an ENTER/LEAVE pair (this allows XS to do things like 'local' - scary but very occasionaly useful). If you don't have an ENTER/LEAVE pair in your code it is some caller's LEAVE.
