This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c: Suppress compiler warning
authorFather Chrysostomos <sprout@cpan.org>
Sat, 29 Jun 2013 01:31:26 +0000 (18:31 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 29 Jun 2013 03:27:26 +0000 (20:27 -0700)
Sorry, commit 08aff5359 was not quite ready and I pushed it too soon.

The purpose of the if block that it removed was to suppress a warn-
ing about an unused variable, but it was a very strange way of accom-
plishing that.

We have a much simpler way that takes only one line and expresses its
intent clearly.

op.c

diff --git a/op.c b/op.c
index daef81a..fc0306a 100644 (file)
--- a/op.c
+++ b/op.c
@@ -11980,6 +11980,7 @@ const_sv_xsub(pTHX_ CV* cv)
     dVAR;
     dXSARGS;
     SV *const sv = MUTABLE_SV(XSANY.any_ptr);
+    PERL_UNUSED_ARG(items);
     if (!sv) {
        XSRETURN(0);
     }