This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix 'might be used uninitialized' in PerlIO_tmpfile
authorDavid Mitchell <davem@iabyn.com>
Wed, 18 Aug 2010 21:31:49 +0000 (22:31 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 18 Aug 2010 21:34:30 +0000 (22:34 +0100)
sv can't actually be used uninitialized, but set it to zero to
shut up stupid compilers

perlio.c

index 57a61d9..ab08bec 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -5156,7 +5156,7 @@ PerlIO_tmpfile(void)
      int fd = -1;
      char tempname[] = "/tmp/PerlIO_XXXXXX";
      const char * const tmpdir = PL_tainting ? NULL : PerlEnv_getenv("TMPDIR");
-     SV * sv;
+     SV * sv = NULL;
      /*
       * I have no idea how portable mkstemp() is ... NI-S
       */