Skip to content

Commit

Permalink
avoid unused-var warnings in compiled XS
Browse files Browse the repository at this point in the history
Code generated by ExtUtils-ParseXS for certain kinds of XS sub
was creating an "items" variable and never using it, resulting in
distracting warnings from the C compiler.  Add "PERL_UNUSED_VAR(items)"
where appropriate.
  • Loading branch information
Zefram committed Nov 14, 2017
1 parent eb32218 commit 5a110b6
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 11 deletions.
4 changes: 4 additions & 0 deletions dist/ExtUtils-ParseXS/Changes
@@ -1,5 +1,9 @@
Revision history for Perl extension ExtUtils::ParseXS.

3.36
- Make generated code avoid warnings about the "items" variable
being unused

3.35 - Mon Jul 31 17:50:00 CET 2017
- Fix ExtUtils-ParseXS/t/*.t that needed '.' in @INC (David Mitchell)
- Remove impediment to compiling under C++11 (Karl Williamson)
Expand Down
6 changes: 4 additions & 2 deletions dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Expand Up @@ -11,7 +11,7 @@ use Symbol;

our $VERSION;
BEGIN {
$VERSION = '3.35';
$VERSION = '3.36';
}
use ExtUtils::ParseXS::Constants $VERSION;
use ExtUtils::ParseXS::CountLines $VERSION;
Expand Down Expand Up @@ -519,9 +519,10 @@ EOF
EOF
}
else {
# cv likely to be unused
# cv and items likely to be unused
print Q(<<"EOF");
# PERL_UNUSED_VAR(cv); /* -W */
# PERL_UNUSED_VAR(items); /* -W */
EOF
}

Expand Down Expand Up @@ -871,6 +872,7 @@ EOF
#XS_EUPXS(XS_$self->{Packid}_nil)
#{
# dXSARGS;
# PERL_UNUSED_VAR(items);
# XSRETURN_EMPTY;
#}
#
Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Constants.pm
Expand Up @@ -3,7 +3,7 @@ use strict;
use warnings;
use Symbol;

our $VERSION = '3.35';
our $VERSION = '3.36';

=head1 NAME
Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/CountLines.pm
@@ -1,7 +1,7 @@
package ExtUtils::ParseXS::CountLines;
use strict;

our $VERSION = '3.35';
our $VERSION = '3.36';

our $SECTION_END_MARKER;

Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Eval.pm
Expand Up @@ -2,7 +2,7 @@ package ExtUtils::ParseXS::Eval;
use strict;
use warnings;

our $VERSION = '3.35';
our $VERSION = '3.36';

=head1 NAME
Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm
Expand Up @@ -5,7 +5,7 @@ use Exporter;
use File::Spec;
use ExtUtils::ParseXS::Constants ();

our $VERSION = '3.35';
our $VERSION = '3.36';

our (@ISA, @EXPORT_OK);
@ISA = qw(Exporter);
Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-ParseXS/lib/ExtUtils/Typemaps.pm
Expand Up @@ -2,7 +2,7 @@ package ExtUtils::Typemaps;
use 5.006001;
use strict;
use warnings;
our $VERSION = '3.35';
our $VERSION = '3.36';

require ExtUtils::ParseXS;
require ExtUtils::ParseXS::Constants;
Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-ParseXS/lib/ExtUtils/Typemaps/Cmd.pm
Expand Up @@ -2,7 +2,7 @@ package ExtUtils::Typemaps::Cmd;
use 5.006001;
use strict;
use warnings;
our $VERSION = '3.35';
our $VERSION = '3.36';

use ExtUtils::Typemaps;

Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-ParseXS/lib/ExtUtils/Typemaps/InputMap.pm
Expand Up @@ -2,7 +2,7 @@ package ExtUtils::Typemaps::InputMap;
use 5.006001;
use strict;
use warnings;
our $VERSION = '3.35';
our $VERSION = '3.36';

=head1 NAME
Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-ParseXS/lib/ExtUtils/Typemaps/OutputMap.pm
Expand Up @@ -2,7 +2,7 @@ package ExtUtils::Typemaps::OutputMap;
use 5.006001;
use strict;
use warnings;
our $VERSION = '3.35';
our $VERSION = '3.36';

=head1 NAME
Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-ParseXS/lib/ExtUtils/Typemaps/Type.pm
Expand Up @@ -4,7 +4,7 @@ use strict;
use warnings;
require ExtUtils::Typemaps;

our $VERSION = '3.35';
our $VERSION = '3.36';

=head1 NAME
Expand Down

0 comments on commit 5a110b6

Please sign in to comment.