On Thu, Jan 29, 2004 at 12:01:01PM +0000 Nick Ing-Simmons wrote:
> Tassilo Parseval <[EMAIL PROTECTED]> writes:
> >On Mon, Jan 26, 2004 at 04:28:23PM -0800 unkno me wrote:
> >
> >
> >As for warnings, I had this problem recently. I have defined two macros:
> >
> >    #define WARN_OFF \
> >        SV *oldwarn = PL_curcop->cop_warnings; \
> >        PL_curcop->cop_warnings = pWARN_NONE;
> >
> >    #define WARN_RESTORE \
> >        PL_curcop->cop_warnings = oldwarn;
> >
> >WARN_RESTORE has to be called in the same scope of WARN_OFF, or you make
> >'oldwarn' a global variable.
> >
> >Nick Ing-Simmons mentioned that one could use save_item() to save the
> >old value of PL_curcop->cop_warnings scope-wise. That however didn't
> >work for me and resulted in segfaults.
> 
> The SAVE stuff in scope.h can probably be used, but I am not entirely 
> surprised save_item() doesn't work. The various save_xxx functions/macros
> have expectations on the things being saved and the scope structure.

In particular they seem to expect 'sv' to be a proper SV*. In case of
warnings, this is Nullsv and so the whole thing explodes.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval

Reply via email to