|
From: | Jacob Bachmeyer |
Subject: | Re: automake-1.17 fails with latest Perl (5.41.8) - Possible precedence problem between ! and numeric eq (==) |
Date: | Tue, 4 Feb 2025 22:29:54 -0600 |
User-agent: | Mozilla Thunderbird |
On 2/4/25 17:56, Karl Berry wrote:
If the concern is making certain that new Perl warnings are noticed, simply putting PERL5OPT='-Mwarnings=FATAL,all' in the environment when running the testsuite should accomplish that. Thanks for the suggestion. I put a note into HACKING about it. I also tried running the tests that way, and discovered one intentional warning in t/parallel-tests-log-compiler-example.sh (and so the test failed). I added an explicit "use warnings" there to override the envvar setting. -k
If a plain "use warnings;" in a script overrides setting PERL5OPT=-Mwarnings=FATAL,all in the environment, then I was wrong and using PERL5OPT like that will /not/ make warnings in Automake code fatal, since every Automake module (should) "use warnings;" and thus end up overriding them to the default of being non-fatal. Oops.
TIMTOWTDI:Automake would need to choose an environment variable or other means of selecting fatal warnings mode and do something like:
use if defined $ENV{'AUTOMAKE_FATAL_PERL_WARNINGS'}, warnings => FATAL => 'all';... in each file to select fatal warnings if desired. It seems that the above must appear *after* the basic "use warnings;" line. The "if" pragma was introduced in Perl 5.6.2 according to corelist(1).
Note that the test above, for concision, checks only that AUTOMAKE_FATAL_PERL_WARNINGS *exists* in the environment and ignores its value.
-- Jacob
[Prev in Thread] | Current Thread | [Next in Thread] |