develooper Front page | perl.perl5.changes | Postings from October 2020

[Perl/perl5] d47b86: t/loc_tools.pl: De-prototype to allow for arrayref

From:
James E Keenan via perl5-changes
Date:
October 23, 2020 23:16
Subject:
[Perl/perl5] d47b86: t/loc_tools.pl: De-prototype to allow for arrayref
Message ID:
Perl/perl5/push/refs/heads/jkeenan/ext-POSIX-t-posix-locales_enabled/000000-d47b86@github.com
  Branch: refs/heads/jkeenan/ext-POSIX-t-posix-locales_enabled
  Home:   https://github.com/Perl/perl5
  Commit: d47b8636a444fc66be8bf9417a09bbe0cc52bb4f
      https://github.com/Perl/perl5/commit/d47b8636a444fc66be8bf9417a09bbe0cc52bb4f
  Author: James E Keenan <jkeenan@cpan.org>
  Date:   2020-10-23 (Fri, 23 Oct 2020)

  Changed paths:
    M ext/POSIX/t/posix.t
    M t/loc_tools.pl

  Log Message:
  -----------
  t/loc_tools.pl: De-prototype to allow for array ref

Running ext/POSIX/t/posix.t with warnings enabled generated a
compile-time error, "Useless use of a constant ("NUMERIC") in void
context".  Analysis suggested it was a problem with t/loc_tools.pl
function locales_enabled(), which was prototyped to accept an optional
scalar reference but not an array reference.  Experimentation suggested
that the best way out of this problem was not to prototype the function.
Rather, account for the possibility that locales_enabled() would take an
array reference as well as existing cases of scalar and no argument at
all.

For : GH #18245



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About