develooper Front page | perl.perl5.porters | Postings from October 2015

Re: patches wanted: default warnings/strict

Thread Previous | Thread Next
From:
Zefram
Date:
October 17, 2015 18:17
Subject:
Re: patches wanted: default warnings/strict
Message ID:
20151017181714.GO9229@fysh.org
Abigail wrote:
>"perldoc -f warnings" talks about default warnings, (as opposed
>to optional warnings), but when it comes down to discussing
>the warnings category hierarchie, there's no peep about
>mandatory vs optional anymore.

That sense of "default warnings" is referring to warnings that are
enabled when there is no warnings pragma in scope.  For example,
deprecation warnings are default in this sense.

(The defaultness of warnings is actually being implemented twice.
warnings.pm contains a $DEFAULT bitset, which is the starting value
for modifying ${^WARNING_BITS} when it was not previously set and $^W
is false.  This implements the default set of warnings where they have
been modified by category-specific pragmata, and it distinguishes them
along category lines.  But when no pragmata at all are in scope, the
core distinguishes default warnings based on whether the warning code
calls Perl_ck_warner_d() rather than Perl_ck_warner(), a method that is
not constrained to match category boundaries.  I think we should merge
these two into a single mechanism that determines defaultness based
purely on category.)

(Also, warnings.pm ought to document which categories constitute default
warnings.)

This means that using "default" as the name of a warnings category or
pseudo-category would be confusing.  The category that "use warnings;"
invokes, if it's not correctly described as "all", might be described as
"recommended" or somesuch.

-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