This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
POSIX.pm: shut up g++ compiler warning
authorDavid Mitchell <davem@iabyn.com>
Thu, 24 Nov 2016 13:52:30 +0000 (13:52 +0000)
committerDavid Mitchell <davem@iabyn.com>
Thu, 24 Nov 2016 13:52:30 +0000 (13:52 +0000)
g++ is too stupid to know that strtoul(..,&unparsed,...) will modify
unparsed. So initialise it to NULL.

POSIX.xs: In function ‘void XS_POSIX_strtoul(PerlInterpreter*, CV*)’:
POSIX.xs:3468:17: warning: ‘unparsed’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                 if (unparsed)

ext/POSIX/POSIX.xs
ext/POSIX/lib/POSIX.pm

index 5c7d81a..0bcebb1 100644 (file)
@@ -3451,7 +3451,7 @@ strtoul(str, base = 0)
        int             base
     PREINIT:
        unsigned long num;
-       char *unparsed;
+       char *unparsed = NULL;
     PPCODE:
        PERL_UNUSED_VAR(str);
        PERL_UNUSED_VAR(base);
index 76d58c9..e187b3b 100644 (file)
@@ -4,7 +4,7 @@ use warnings;
 
 our ($AUTOLOAD, %SIGRT);
 
-our $VERSION = '1.75';
+our $VERSION = '1.76';
 
 require XSLoader;