From: Robin Barker Date: Thu, 20 Dec 2007 18:29:25 +0000 (+0000) Subject: make miniperl -Wwrite-strings clean X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=360ea906b19e0bdcdbc4a4ce534a035d46a949d5;p=p5sagit%2Fp5-mst-13.2.git make miniperl -Wwrite-strings clean From: "Robin Barker" Message-ID: <46A0F33545E63740BC7563DE59CA9C6D09399A@exchsvr2.npl.ad.local> p4raw-id: //depot/perl@32681 --- diff --git a/doio.c b/doio.c index 5ccf73b..5e7a5a1 100644 --- a/doio.c +++ b/doio.c @@ -1384,14 +1384,14 @@ Perl_do_aexec5(pTHX_ SV *really, register SV **mark, register SV **sp, Perl_croak(aTHX_ "exec? I'm not *that* kind of operating system"); #else if (sp > mark) { - char **a; + const char **a; const char *tmps = NULL; - Newx(PL_Argv, sp - mark + 1, char*); + Newx(PL_Argv, sp - mark + 1, const char*); a = PL_Argv; while (++mark <= sp) { if (*mark) - *a++ = (char*)SvPV_nolen_const(*mark); + *a++ = SvPV_nolen_const(*mark); else *a++ = ""; } @@ -1430,7 +1430,7 @@ bool Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report) { dVAR; - register char **a; + register const char **a; register char *s; char *buf; char *cmd; @@ -1526,7 +1526,7 @@ Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report) } } - 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;) { @@ -1542,7 +1542,7 @@ Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report) *a = NULL; if (PL_Argv[0]) { PERL_FPU_PRE_EXEC - PerlProc_execvp(PL_Argv[0],PL_Argv); + PerlProc_execvp(PL_Argv[0],EXEC_ARGV_CAST(PL_Argv)); PERL_FPU_POST_EXEC if (errno == ENOEXEC) { /* for system V NIH syndrome */ do_execfree(); diff --git a/intrpvar.h b/intrpvar.h index 7799812..10d8c12 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -348,7 +348,7 @@ PERLVARI(Icurcopdb, COP *, NULL) PERLVAR(Ifilemode, int) /* so nextargv() can preserve mode */ PERLVAR(Ilastfd, int) /* what to preserve mode on */ PERLVAR(Ioldname, char *) /* what to preserve mode on */ -PERLVAR(IArgv, char **) /* stuff to free from do_aexec, vfork safe */ +PERLVAR(IArgv, const char **) /* stuff to free from do_aexec, vfork safe */ PERLVAR(ICmd, char *) /* stuff to free from do_aexec, vfork safe */ /* Elements in this array have ';' appended and are injected as a single line into the tokeniser. You can't put any (literal) newlines into any program diff --git a/overload.c b/overload.c index eaaef21..0a1ea3d 100644 --- a/overload.c +++ b/overload.c @@ -85,7 +85,7 @@ const U8 PL_AMG_namelens[NofAMmeth] = { 7 }; -char * const PL_AMG_names[NofAMmeth] = { +const char * const PL_AMG_names[NofAMmeth] = { /* Names kept in the symbol table. fallback => "()", the rest has "(" prepended. The only other place in perl which knows about this convention is AMG_id2name (used for debugging output and diff --git a/overload.pl b/overload.pl index a86222e..0c25cdf 100644 --- a/overload.pl +++ b/overload.pl @@ -84,7 +84,7 @@ print C <<"EOT"; $lastlen }; -char * const PL_AMG_names[NofAMmeth] = { +const char * const PL_AMG_names[NofAMmeth] = { /* Names kept in the symbol table. fallback => "()", the rest has "(" prepended. The only other place in perl which knows about this convention is AMG_id2name (used for debugging output and diff --git a/perl.h b/perl.h index e48f768..854a8c9 100644 --- a/perl.h +++ b/perl.h @@ -5686,7 +5686,7 @@ int flock(int fd, int op); #endif #ifndef EXEC_ARGV_CAST -#define EXEC_ARGV_CAST(x) x +#define EXEC_ARGV_CAST(x) (char **)x #endif #define IS_NUMBER_IN_UV 0x01 /* number within UV range (maybe not