This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move code to after the variable declarations.
authorNicholas Clark <nick@ccl4.org>
Thu, 6 May 2010 09:16:02 +0000 (10:16 +0100)
committerNicholas Clark <nick@ccl4.org>
Thu, 6 May 2010 09:17:11 +0000 (10:17 +0100)
Currently we only compile the top level code with "extreme warnings", so code
in ext/ isn't subject to -Wdeclaration-after-statement, hence why this was
missed. Now that dual life modules have been evicted from ext/, we could
probably consider notching up the warnings for all code in ext/.

ext/PerlIO-scalar/scalar.xs

index 67f674a..f2481f4 100644 (file)
@@ -85,9 +85,12 @@ IV
 PerlIOScalar_seek(pTHX_ PerlIO * f, Off_t offset, int whence)
 {
     PerlIOScalar *s = PerlIOSelf(f, PerlIOScalar);
-    SvGETMAGIC(s->var);
-    STRLEN oldcur = SvCUR(s->var);
+    STRLEN oldcur;
     STRLEN newlen;
+
+    SvGETMAGIC(s->var);
+    oldcur = SvCUR(s->var);
+
     switch (whence) {
     case SEEK_SET:
        s->posn = offset;