Skip to content

Commit fa6606c

Browse files
committed
ParseXS - Disable alias value collision warnings by default
We always had a bug with the value 0, when fixing it, we discovered a lot of people were doing duplicate aliases with 0. This patch disables the warnings except when in a special author mode, as it makes no sense to show these warnings to end users. It would seem most times creating such aliases is not an issue and is entirely deliberate. So showing such warnings only to module authors and only on request also makes sense.
1 parent eae8123 commit fa6606c

File tree

12 files changed

+31
-12
lines changed

12 files changed

+31
-12
lines changed

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use Symbol;
1111

1212
our $VERSION;
1313
BEGIN {
14-
$VERSION = '3.48';
14+
$VERSION = '3.49';
1515
require ExtUtils::ParseXS::Constants; ExtUtils::ParseXS::Constants->VERSION($VERSION);
1616
require ExtUtils::ParseXS::CountLines; ExtUtils::ParseXS::CountLines->VERSION($VERSION);
1717
require ExtUtils::ParseXS::Utilities; ExtUtils::ParseXS::Utilities->VERSION($VERSION);
@@ -49,6 +49,8 @@ our @EXPORT_OK = qw(
4949
##############################
5050
# A number of "constants"
5151
our $DIE_ON_ERROR;
52+
our $AUTHOR_WARNINGS;
53+
$AUTHOR_WARNINGS //= ($ENV{AUTHOR_WARNINGS} || 0);
5254
our ($C_group_rex, $C_arg);
5355
# Group in C (no support for comments or literals)
5456
$C_group_rex = qr/ [({\[]
@@ -105,6 +107,7 @@ sub process_file {
105107
versioncheck => 1,
106108
FH => Symbol::gensym(),
107109
die_on_error => $DIE_ON_ERROR, # if true we die() and not exit() after errors
110+
author_warnings => $AUTHOR_WARNINGS,
108111
%options,
109112
);
110113
$args{except} = $args{except} ? ' TRY' : '';
@@ -136,6 +139,7 @@ sub process_file {
136139
$self->{IncludedFiles} = {};
137140

138141
$self->{die_on_error} = $args{die_on_error};
142+
$self->{author_warnings} = $args{author_warnings};
139143

140144
die "Missing required parameter 'filename'" unless $args{filename};
141145
$self->{filepathname} = $args{filename};
@@ -1372,7 +1376,10 @@ sub get_aliases {
13721376
# yet as 0 is the default for the base function ($fname)
13731377
push @keys, $fname
13741378
if $value eq "0" and !defined $self->{XsubAlias}{$fname};
1375-
if (@keys) {
1379+
if (@keys and $self->{author_warnings}) {
1380+
# We do not warn about value collisions unless author_warnings
1381+
# are enabled. They aren't helpful to a module consumer, only
1382+
# the module author.
13761383
@keys= map { "'$_'" }
13771384
map { my $copy= $_;
13781385
$copy=~s/^$self->{Packprefix}//;

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Constants.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use strict;
33
use warnings;
44
use Symbol;
55

6-
our $VERSION = '3.48';
6+
our $VERSION = '3.49';
77

88
=head1 NAME
99

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/CountLines.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package ExtUtils::ParseXS::CountLines;
22
use strict;
33

4-
our $VERSION = '3.48';
4+
our $VERSION = '3.49';
55

66
our $SECTION_END_MARKER;
77

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Eval.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package ExtUtils::ParseXS::Eval;
22
use strict;
33
use warnings;
44

5-
our $VERSION = '3.48';
5+
our $VERSION = '3.49';
66

77
=head1 NAME
88

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use Exporter;
55
use File::Spec;
66
use ExtUtils::ParseXS::Constants ();
77

8-
our $VERSION = '3.48';
8+
our $VERSION = '3.49';
99

1010
our (@ISA, @EXPORT_OK);
1111
@ISA = qw(Exporter);

dist/ExtUtils-ParseXS/lib/ExtUtils/Typemaps.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package ExtUtils::Typemaps;
22
use 5.006001;
33
use strict;
44
use warnings;
5-
our $VERSION = '3.48';
5+
our $VERSION = '3.49';
66

77
require ExtUtils::ParseXS;
88
require ExtUtils::ParseXS::Constants;

dist/ExtUtils-ParseXS/lib/ExtUtils/Typemaps/Cmd.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package ExtUtils::Typemaps::Cmd;
22
use 5.006001;
33
use strict;
44
use warnings;
5-
our $VERSION = '3.48';
5+
our $VERSION = '3.49';
66

77
use ExtUtils::Typemaps;
88

dist/ExtUtils-ParseXS/lib/ExtUtils/Typemaps/InputMap.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package ExtUtils::Typemaps::InputMap;
22
use 5.006001;
33
use strict;
44
use warnings;
5-
our $VERSION = '3.48';
5+
our $VERSION = '3.49';
66

77
=head1 NAME
88

dist/ExtUtils-ParseXS/lib/ExtUtils/Typemaps/OutputMap.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package ExtUtils::Typemaps::OutputMap;
22
use 5.006001;
33
use strict;
44
use warnings;
5-
our $VERSION = '3.48';
5+
our $VERSION = '3.49';
66

77
=head1 NAME
88

dist/ExtUtils-ParseXS/lib/ExtUtils/Typemaps/Type.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use strict;
44
use warnings;
55
require ExtUtils::Typemaps;
66

7-
our $VERSION = '3.48';
7+
our $VERSION = '3.49';
88

99
=head1 NAME
1010

0 commit comments

Comments
 (0)