Subject: | ExtUtils::MM_Unix.pm: uninitialized value |
While running 'make test_harness' on Perl 5 blead at commit 5b2ef88ec2b538ad872eb354160909d8bd529aa7, where in cpan/ExtUtils-MakeMaker/lib/MM_Unix.pm is at $VERSION = '7.18_01', I observed an uninitialized value warning in t/02-xsdynamic.t, t/build_man.t, t/echo.t and other files.
In some cases we have 2 uninitialized variables. Example:
#####
XXX: t/echo.t^M
Use of uninitialized value in concatenation (.) or string at /home/jkeenan/gitwork/perl/cpan/ExtUtils-MakeMaker/../../lib/ExtUtils/MM_Unix.pm line 2068.^M
XXX: PERL_ARCHLIB: <>^M
Use of uninitialized value in concatenation (.) or string at /home/jkeenan/gitwork/perl/cpan/ExtUtils-MakeMaker/../../lib/ExtUtils/MM_Unix.pm line 2069.^M
XXX: PERLLIB: <>^M
#####
In other cases, only one of the 2 variables in the 'ne' comparison is uninitialized:
#####
XXX: t/02-xsdynamic.t^M
XXX: PERL_ARCHLIB: <../../../../lib>^M
Use of uninitialized value in concatenation (.) or string at /home/jkeenan/gitwork/perl/cpan/ExtUtils-MakeMaker/../../lib/ExtUtils/MM_Unix.pm line 2069.^M
XXX: PERLLIB: <>^M
#####
I see that in github.com the code for this line differs from that in Perl 5 blead, so perhaps this flaw has already been discovered. If so, then this should be checked when blead is updated. If not, then something like the attached will probably work.
Subject: | 0001-Make-sure-2-variables-are-initialized-in-ne-comparis.patch |
From ee92f31168cd5085c19b7f2b77d556f0e9ebb0d1 Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Thu, 4 Aug 2016 19:36:05 -0400
Subject: [PATCH] Make sure 2 variables are initialized in 'ne' comparison.
---
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
index 6763e57..0aba270 100644
--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
@@ -2065,7 +2065,7 @@ sub init_PERL {
# Make sure perl can find itself before it's installed.
my $lib_paths = $self->{UNINSTALLED_PERL} || $self->{PERL_CORE}
- ? $self->{PERL_ARCHLIB} ne $self->{PERL_LIB} ?
+ ? ($self->{PERL_ARCHLIB} || '') ne ($self->{PERL_LIB} || '') ?
q{ "-I$(PERL_LIB)" "-I$(PERL_ARCHLIB)"} : q{ "-I$(PERL_LIB)"}
: undef;
my $inst_lib_paths = $self->{INST_ARCHLIB} ne $self->{INST_LIB}
--
2.7.4