This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix Cygwin build warnings
authorJerry D. Hedden <jdhedden@cpan.org>
Wed, 29 Aug 2012 14:55:12 +0000 (10:55 -0400)
committerTony Cook <tony@develop-help.com>
Thu, 30 Aug 2012 00:59:59 +0000 (10:59 +1000)
Fixes the following build warnings under Cygwin:

cygwin.c: In function 'do_spawn':
cygwin.c:132:5: warning: assignment from incompatible pointer type
cygwin.c: In function 'XS_Cygwin_posix_to_win_path':
cygwin.c:346:9: warning: 'err' may be used uninitialized in this function
cygwin.c: In function 'XS_Cygwin_win_to_posix_path':
cygwin.c:257:9: warning: 'err' may be used uninitialized in this function

cygwin/cygwin.c

index 29ee22e..87401d1 100644 (file)
@@ -129,7 +129,7 @@ do_spawn (char *cmd)
            return do_spawnvp("sh",command);
        }
 
-    Newx (PL_Argv,(s-cmd)/2+2,char*);
+    Newx (PL_Argv, (s-cmd)/2+2, const char*);
     PL_Cmd=savepvn (cmd,s-cmd);
     a=PL_Argv;
     for (s=PL_Cmd; *s;) {
@@ -254,7 +254,7 @@ XS(XS_Cygwin_win_to_posix_path)
     dXSARGS;
     int absolute_flag = 0;
     STRLEN len;
-    int err;
+    int err = 0;
     char *src_path;
     char *posix_path;
     int isutf8 = 0;
@@ -343,7 +343,7 @@ XS(XS_Cygwin_posix_to_win_path)
     dXSARGS;
     int absolute_flag = 0;
     STRLEN len;
-    int err;
+    int err = 0;
     char *src_path, *win_path;
     int isutf8 = 0;