develooper Front page | perl.perl5.porters | Postings from March 2013

Re: [perl #113794] "in cleanup" warnings generated from destructorerrors are no longer enabled by "use warnings"

Thread Previous | Thread Next
From:
Zefram
Date:
March 28, 2013 11:08
Subject:
Re: [perl #113794] "in cleanup" warnings generated from destructorerrors are no longer enabled by "use warnings"
Message ID:
20130328110840.GM18166@lake.fysh.org
Jesse Luehrs wrote:
>This seems unintentional.

Indeed.  The Perl_ck_warner() call in die_unwind() used to happen before
unwinding, so would be affected by the lexical warning state at the die()
site.  Now it happens after unwinding, so takes the lexical warning state
at the catching site.  I don't have a clear idea of which behaviour is
more correct.  t/op/die_keeperr.t, which was introduced as part of my
exception handling changes, is actually testing for the catching-site
criterion, but that's not asserting that the criterion should be that.
The documentation speaks of "no warnings 'misc'", but doesn't say which
lexical scope matters.

Assuming we want to revert this change, the easy fix is to move
the conditional Perl_ck_warner() back to before unwinding.  A more
difficult way would be to determine the disposition of the warning
before unwinding and then warn in the required manner after unwinding.
I see no compelling reason to warn after unwinding rather than before,
so just moving the warning code should be fine.

Patch attached.

-zefram

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