This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PerlIO::scalar: silence some compiler warnings
authorDavid Mitchell <davem@iabyn.com>
Mon, 18 Nov 2013 14:37:22 +0000 (14:37 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 18 Nov 2013 17:14:22 +0000 (17:14 +0000)
ext/PerlIO-scalar/scalar.xs

index a104887..8d217c9 100644 (file)
@@ -199,7 +199,7 @@ PerlIOScalar_write(pTHX_ PerlIO * f, const void *vbuf, Size_t count)
        }
        else {
            STRLEN const cur = SvCUR(sv);
-           if (s->posn > cur) {
+           if ((STRLEN)s->posn > cur) {
                dst = SvGROW(sv, (STRLEN)s->posn + count + 1);
                Zero(SvPVX(sv) + cur, (STRLEN)s->posn - cur, char);
            }
@@ -340,7 +340,7 @@ PerlIOScalar_dup(pTHX_ PerlIO * f, PerlIO * o, CLONE_PARAMS * param,
        ing the cloned scalar to be set to the empty string by
        PerlIOScalar_pushed.  So set aside our scalar temporarily. */
     PerlIOScalar * const os = PerlIOSelf(o, PerlIOScalar);
-    PerlIOScalar *fs;
+    PerlIOScalar *fs = NULL; /* avoid "may be used uninitialized" warning */
     SV * const var = os->var;
     os->var = newSVpvs("");
     if ((f = PerlIOBase_dup(aTHX_ f, o, param, flags))) {