This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PerlIOScalar_eof(): silence compiler warning:
authorDavid Mitchell <davem@iabyn.com>
Thu, 22 Dec 2016 10:27:40 +0000 (10:27 +0000)
committerDavid Mitchell <davem@iabyn.com>
Thu, 22 Dec 2016 10:27:40 +0000 (10:27 +0000)
    scalar.xs:23:15: warning: variable ā€˜pā€™ set but not used
    [-Wunused-but-set-variable]
         char *p;

I'm not sure why this has only started warning, but this commit shuts it
up anyway.

ext/PerlIO-scalar/scalar.xs

index dcb8283..c9a24db 100644 (file)
@@ -20,9 +20,8 @@ PerlIOScalar_eof(pTHX_ PerlIO * f)
 {
     if (PerlIOBase(f)->flags & PERLIO_F_CANREAD) {
         PerlIOScalar *s = PerlIOSelf(f, PerlIOScalar);
-        char *p;
         STRLEN len;
-        p = SvPV(s->var, len);
+        (void)SvPV(s->var, len);
         return len - (STRLEN)(s->posn) <= 0;
     }
     return 1;