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.


>
>Tassilo

Reply via email to