Change 34718 by [EMAIL PROTECTED] on 2008/11/04 09:38:17
Integrate:
[ 34707]
Integrate:
[ 34694]
Explicitly specify some printf formats for constant strings.
This is mostly to silence gcc's warning, "format not a string
literal and no format arguments".
[ 34695]
Subject: [PATCH] explicit empty while loops
From: "Robin Barker" <[EMAIL PROTECTED]>
Date: Wed, 29 Oct 2008 13:22:04 -0000
Message-ID: <[EMAIL PROTECTED]>
[ 34700]
Silence one more format warning
Affected files ...
... //depot/maint-5.8/perl/av.c#50 integrate
... //depot/maint-5.8/perl/doop.c#57 integrate
... //depot/maint-5.8/perl/ext/PerlIO/scalar/scalar.xs#14 integrate
... //depot/maint-5.8/perl/handy.h#62 integrate
... //depot/maint-5.8/perl/mg.c#168 integrate
... //depot/maint-5.8/perl/op.c#235 integrate
... //depot/maint-5.8/perl/perl.c#237 integrate
... //depot/maint-5.8/perl/pp.c#154 integrate
... //depot/maint-5.8/perl/pp_ctl.c#196 integrate
... //depot/maint-5.8/perl/pp_hot.c#149 integrate
... //depot/maint-5.8/perl/pp_sort.c#52 integrate
... //depot/maint-5.8/perl/pp_sys.c#164 integrate
... //depot/maint-5.8/perl/sv.c#394 integrate
... //depot/maint-5.8/perl/toke.c#183 integrate
... //depot/maint-5.8/perl/util.c#167 integrate
Differences ...
==== //depot/maint-5.8/perl/av.c#50 (text) ====
Index: perl/av.c
--- perl/av.c#49~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/av.c 2008-11-04 01:38:17.000000000 -0800
@@ -314,7 +314,7 @@
}
if (SvREADONLY(av) && key >= AvFILL(av))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
if (!AvREAL(av) && AvREIFY(av))
av_reify(av);
@@ -419,7 +419,7 @@
return;
if (SvREADONLY(av))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
/* Give any tie a chance to cleanup first */
if (SvRMAGICAL(av))
@@ -534,7 +534,7 @@
if (!av)
return;
if (SvREADONLY(av))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
if ((mg = SvTIED_mg((SV*)av, PERL_MAGIC_tied))) {
dSP;
@@ -571,7 +571,7 @@
if (!av)
return &PL_sv_undef;
if (SvREADONLY(av))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
if ((mg = SvTIED_mg((SV*)av, PERL_MAGIC_tied))) {
dSP;
PUSHSTACKi(PERLSI_MAGIC);
@@ -636,7 +636,7 @@
if (!av)
return;
if (SvREADONLY(av))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
if ((mg = SvTIED_mg((SV*)av, PERL_MAGIC_tied))) {
dSP;
@@ -707,7 +707,7 @@
if (!av)
return &PL_sv_undef;
if (SvREADONLY(av))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
if ((mg = SvTIED_mg((SV*)av, PERL_MAGIC_tied))) {
dSP;
PUSHSTACKi(PERLSI_MAGIC);
@@ -830,7 +830,7 @@
if (!av)
return NULL;
if (SvREADONLY(av))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
if (SvRMAGICAL(av)) {
const MAGIC * const tied_magic = mg_find((SV*)av, PERL_MAGIC_tied);
==== //depot/maint-5.8/perl/doop.c#57 (text) ====
Index: perl/doop.c
--- perl/doop.c#56~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/doop.c 2008-11-04 01:38:17.000000000 -0800
@@ -619,7 +619,7 @@
if (SvFAKE(sv))
sv_force_normal(sv);
if (SvREADONLY(sv) && !(PL_op->op_private & OPpTRANS_IDENTICAL))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
}
(void)SvPV_const(sv, len);
if (!len)
@@ -989,7 +989,7 @@
sv_force_normal_flags(sv, 0);
}
if (SvREADONLY(sv))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
}
if (PL_encoding && !SvUTF8(sv)) {
@@ -1072,7 +1072,7 @@
sv_force_normal_flags(sv, 0);
}
if (SvREADONLY(sv))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
}
if (PL_encoding) {
==== //depot/maint-5.8/perl/ext/PerlIO/scalar/scalar.xs#14 (text) ====
Index: perl/ext/PerlIO/scalar/scalar.xs
--- perl/ext/PerlIO/scalar/scalar.xs#13~33214~ 2008-02-02 14:01:39.000000000
-0800
+++ perl/ext/PerlIO/scalar/scalar.xs 2008-11-04 01:38:17.000000000 -0800
@@ -26,7 +26,7 @@
if (SvROK(arg)) {
if (SvREADONLY(SvRV(arg)) && mode && *mode != 'r') {
if (ckWARN(WARN_LAYER))
- Perl_warner(aTHX_ packWARN(WARN_LAYER), PL_no_modify);
+ Perl_warner(aTHX_ packWARN(WARN_LAYER), "%s", PL_no_modify);
SETERRNO(EINVAL, SS_IVCHAN);
return -1;
}
==== //depot/maint-5.8/perl/handy.h#62 (text) ====
Index: perl/handy.h
--- perl/handy.h#61~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/handy.h 2008-11-04 01:38:17.000000000 -0800
@@ -703,10 +703,10 @@
#ifdef PERL_MALLOC_WRAP
#define MEM_WRAP_CHECK(n,t) MEM_WRAP_CHECK_1(n,t,PL_memory_wrap)
#define MEM_WRAP_CHECK_1(n,t,a) \
- (void)(sizeof(t) > 1 && ((MEM_SIZE)(n)+0.0) > MEM_SIZE_MAX/sizeof(t) &&
(Perl_croak_nocontext(a),0))
+ (void)(sizeof(t) > 1 && ((MEM_SIZE)(n)+0.0) > MEM_SIZE_MAX/sizeof(t) &&
(Perl_croak_nocontext("%s",(a)),0))
#define MEM_WRAP_CHECK_(n,t) MEM_WRAP_CHECK(n,t),
-#define PERL_STRLEN_ROUNDUP(n) ((void)(((n) > MEM_SIZE_MAX - 2 *
PERL_STRLEN_ROUNDUP_QUANTUM) ?
(Perl_croak_nocontext(PL_memory_wrap),0):0),((n-1+PERL_STRLEN_ROUNDUP_QUANTUM)&~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM-1)))
+#define PERL_STRLEN_ROUNDUP(n) ((void)(((n) > MEM_SIZE_MAX - 2 *
PERL_STRLEN_ROUNDUP_QUANTUM) ?
(Perl_croak_nocontext("%s",PL_memory_wrap),0):0),((n-1+PERL_STRLEN_ROUNDUP_QUANTUM)&~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM-1)))
#else
==== //depot/maint-5.8/perl/mg.c#168 (text) ====
Index: perl/mg.c
--- perl/mg.c#167~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/mg.c 2008-11-04 01:38:17.000000000 -0800
@@ -571,7 +571,7 @@
{
PERL_UNUSED_ARG(sv);
PERL_UNUSED_ARG(mg);
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
NORETURN_FUNCTION_END;
}
==== //depot/maint-5.8/perl/op.c#235 (text) ====
Index: perl/op.c
--- perl/op.c#234~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/op.c 2008-11-04 01:38:17.000000000 -0800
@@ -6601,7 +6601,7 @@
const char *p = proto;
const char *const end = proto;
contextclass = 0;
- while (*--p != '[');
+ while (*--p != '[') {}
bad_type(arg, Perl_form(aTHX_ "one of %.*s",
(int)(end - p), p),
gv_ename(namegv), o2);
==== //depot/maint-5.8/perl/perl.c#237 (text) ====
Index: perl/perl.c
--- perl/perl.c#236~34616~ 2008-10-28 05:39:20.000000000 -0700
+++ perl/perl.c 2008-11-04 01:38:17.000000000 -0800
@@ -2931,7 +2931,7 @@
PUTBACK;
if (croak_on_error && SvTRUE(ERRSV)) {
- Perl_croak(aTHX_ SvPVx_nolen_const(ERRSV));
+ Perl_croak(aTHX_ "%s", SvPVx_nolen_const(ERRSV));
}
return sv;
==== //depot/maint-5.8/perl/pp.c#154 (text) ====
Index: perl/pp.c
--- perl/pp.c#153~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/pp.c 2008-11-04 01:38:17.000000000 -0800
@@ -158,7 +158,7 @@
* NI-S 1999/05/07
*/
if (SvREADONLY(sv))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
if (PL_op->op_private & OPpDEREF) {
GV *gv;
if (cUNOP->op_targ) {
@@ -307,7 +307,7 @@
else if (gv)
sv = save_scalar(gv);
else
- Perl_croak(aTHX_ PL_no_localize_ref);
+ Perl_croak(aTHX_ "%s", PL_no_localize_ref);
}
else if (PL_op->op_private & OPpDEREF)
vivify_ref(sv, PL_op->op_private & OPpDEREF);
@@ -881,7 +881,7 @@
{
dSP;
if (SvTYPE(TOPs) > SVt_PVLV)
- DIE(aTHX_ PL_no_modify);
+ DIE(aTHX_ "%s", PL_no_modify);
if (!SvREADONLY(TOPs) && SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs)
&& SvIVX(TOPs) != IV_MIN)
{
@@ -898,7 +898,7 @@
{
dSP; dTARGET;
if (SvTYPE(TOPs) > SVt_PVLV)
- DIE(aTHX_ PL_no_modify);
+ DIE(aTHX_ "%s", PL_no_modify);
sv_setsv(TARG, TOPs);
if (!SvREADONLY(TOPs) && SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs)
&& SvIVX(TOPs) != IV_MAX)
@@ -920,7 +920,7 @@
{
dSP; dTARGET;
if (SvTYPE(TOPs) > SVt_PVLV)
- DIE(aTHX_ PL_no_modify);
+ DIE(aTHX_ "%s", PL_no_modify);
sv_setsv(TARG, TOPs);
if (!SvREADONLY(TOPs) && SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs)
&& SvIVX(TOPs) != IV_MIN)
==== //depot/maint-5.8/perl/pp_ctl.c#196 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#195~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/pp_ctl.c 2008-11-04 01:38:17.000000000 -0800
@@ -1371,7 +1371,8 @@
sv_catpvn(err, message, msglen);
if (ckWARN(WARN_MISC)) {
const STRLEN start = SvCUR(err)-msglen-sizeof(prefix)+1;
- Perl_warner(aTHX_ packWARN(WARN_MISC),
SvPVX_const(err)+start);
+ Perl_warner(aTHX_ packWARN(WARN_MISC), "%s",
+ SvPVX_const(err)+start);
}
}
}
==== //depot/maint-5.8/perl/pp_hot.c#149 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#148~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/pp_hot.c 2008-11-04 01:38:17.000000000 -0800
@@ -415,7 +415,7 @@
{
dSP;
if (SvTYPE(TOPs) > SVt_PVLV)
- DIE(aTHX_ PL_no_modify);
+ DIE(aTHX_ "%s", PL_no_modify);
if (!SvREADONLY(TOPs) && SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs)
&& SvIVX(TOPs) != IV_MAX)
{
@@ -779,7 +779,7 @@
}
else if (PL_op->op_flags & OPf_MOD
&& PL_op->op_private & OPpLVAL_INTRO)
- Perl_croak(aTHX_ PL_no_localize_ref);
+ Perl_croak(aTHX_ "%s", PL_no_localize_ref);
}
else {
if (SvTYPE(sv) == type || SvTYPE(sv) == SVt_PVAV) {
@@ -941,7 +941,7 @@
}
else
err = "Odd number of elements in hash assignment";
- Perl_warner(aTHX_ packWARN(WARN_MISC), err);
+ Perl_warner(aTHX_ packWARN(WARN_MISC), "%s", err);
}
if (SvTYPE(hash) == SVt_PVAV) {
/* pseudohash */
@@ -2033,7 +2033,7 @@
if (SvREADONLY(TARG)
|| (SvTYPE(TARG) > SVt_PVLV
&& !(SvTYPE(TARG) == SVt_PVGV && SvFAKE(TARG))))
- DIE(aTHX_ PL_no_modify);
+ DIE(aTHX_ "%s", PL_no_modify);
PUTBACK;
s = SvPV_mutable(TARG, len);
@@ -3043,7 +3043,7 @@
SvGETMAGIC(sv);
if (!SvOK(sv)) {
if (SvREADONLY(sv))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
if (SvTYPE(sv) < SVt_RV)
sv_upgrade(sv, SVt_RV);
else if (SvTYPE(sv) >= SVt_PV) {
==== //depot/maint-5.8/perl/pp_sort.c#52 (text) ====
Index: perl/pp_sort.c
--- perl/pp_sort.c#51~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/pp_sort.c 2008-11-04 01:38:17.000000000 -0800
@@ -202,7 +202,7 @@
if (r >= t) p = r = t; /* too short to care about */
else {
while (((cmp(aTHX_ *(p-1), *p) > 0) == sense) &&
- ((p -= 2) > q));
+ ((p -= 2) > q)) {}
if (p <= q) {
/* b through r is a (long) run.
** Extend it as far as possible.
@@ -1557,7 +1557,7 @@
}
else {
if (SvREADONLY(av))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
else
SvREADONLY_on(av);
p1 = p2 = AvARRAY(av);
==== //depot/maint-5.8/perl/pp_sys.c#164 (text) ====
Index: perl/pp_sys.c
--- perl/pp_sys.c#163~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/pp_sys.c 2008-11-04 01:38:17.000000000 -0800
@@ -1011,7 +1011,7 @@
if (SvIsCOW(sv))
sv_force_normal_flags(sv, 0);
if (SvREADONLY(sv) && !(SvPOK(sv) && SvCUR(sv) == 0))
- DIE(aTHX_ PL_no_modify);
+ DIE(aTHX_ "%s", PL_no_modify);
}
if (!SvPOK(sv)) {
if (ckWARN(WARN_MISC))
==== //depot/maint-5.8/perl/sv.c#394 (text) ====
Index: perl/sv.c
--- perl/sv.c#393~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/sv.c 2008-11-04 01:38:17.000000000 -0800
@@ -3114,7 +3114,7 @@
sv_force_normal_flags(sv, 0);
}
if (SvREADONLY(sv)) {
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
}
(void) sv_utf8_upgrade(sv);
SvUTF8_off(sv);
@@ -3213,7 +3213,7 @@
#ifdef GV_UNIQUE_CHECK
if (GvUNIQUE((GV*)dstr)) {
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
}
#endif
@@ -3244,7 +3244,7 @@
#ifdef GV_UNIQUE_CHECK
if (GvUNIQUE((GV*)dstr)) {
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
}
#endif
@@ -3814,7 +3814,7 @@
unsharepvn(pvx, SvUTF8(sv) ? -(I32)len : (I32)len, hash);
}
else if (IN_PERL_RUNTIME)
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
}
if (SvROK(sv))
sv_unref_flags(sv, flags);
@@ -4173,7 +4173,7 @@
&& how != PERL_MAGIC_backref
)
{
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
}
}
if (SvMAGICAL(sv) || (how == PERL_MAGIC_taint && SvTYPE(sv) >= SVt_PVMG)) {
@@ -6139,7 +6139,7 @@
sv_force_normal(sv);
if (SvREADONLY(sv)) {
if (IN_PERL_RUNTIME)
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
}
if (SvROK(sv)) {
IV i;
@@ -6294,7 +6294,7 @@
sv_force_normal(sv);
if (SvREADONLY(sv)) {
if (IN_PERL_RUNTIME)
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
}
if (SvROK(sv)) {
IV i;
@@ -7676,7 +7676,7 @@
if (SvIsCOW(tmpRef))
sv_force_normal_flags(tmpRef, 0);
if (SvREADONLY(tmpRef))
- Perl_croak(aTHX_ PL_no_modify);
+ Perl_croak(aTHX_ "%s", PL_no_modify);
if (SvOBJECT(tmpRef)) {
if (SvTYPE(tmpRef) != SVt_PVIO)
--PL_sv_objcount;
@@ -9132,7 +9132,7 @@
have = esignlen + zeros + elen;
if (have < zeros)
- Perl_croak_nocontext(PL_memory_wrap);
+ Perl_croak_nocontext("%s", PL_memory_wrap);
if (is_utf8 != has_utf8) {
if (is_utf8) {
@@ -9161,7 +9161,7 @@
gap = need - have;
if (need >= (((STRLEN)~0) - SvCUR(sv) - dotstrlen - 1))
- Perl_croak_nocontext(PL_memory_wrap);
+ Perl_croak_nocontext("%s", PL_memory_wrap);
SvGROW(sv, SvCUR(sv) + need + dotstrlen + 1);
p = SvEND(sv);
if (esignlen && fill == '0') {
==== //depot/maint-5.8/perl/toke.c#183 (text) ====
Index: perl/toke.c
--- perl/toke.c#182~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/toke.c 2008-11-04 01:38:17.000000000 -0800
@@ -3750,7 +3750,7 @@
&& isIDFIRST_lazy_if(s,UTF))
{
CopLINE_dec(PL_curcop);
- Perl_warner(aTHX_ packWARN(WARN_SEMICOLON), PL_warn_nosemi);
+ Perl_warner(aTHX_ packWARN(WARN_SEMICOLON), "%s",
PL_warn_nosemi);
CopLINE_inc(PL_curcop);
}
BAop(OP_BIT_AND);
@@ -4355,7 +4355,7 @@
if (PL_expect == XOPERATOR) {
if (PL_bufptr == PL_linestart) {
CopLINE_dec(PL_curcop);
- Perl_warner(aTHX_ packWARN(WARN_SEMICOLON),
PL_warn_nosemi);
+ Perl_warner(aTHX_ packWARN(WARN_SEMICOLON), "%s",
PL_warn_nosemi);
CopLINE_inc(PL_curcop);
}
else
==== //depot/maint-5.8/perl/util.c#167 (text) ====
Index: perl/util.c
--- perl/util.c#166~34633~ 2008-10-29 01:22:26.000000000 -0700
+++ perl/util.c 2008-11-04 01:38:17.000000000 -0800
@@ -271,12 +271,12 @@
if (size && (count <= MEM_SIZE_MAX / size))
total_size = size * count;
else
- Perl_croak_nocontext(PL_memory_wrap);
+ Perl_croak_nocontext("%s", PL_memory_wrap);
#ifdef PERL_TRACK_MEMPOOL
if (sTHX <= MEM_SIZE_MAX - (MEM_SIZE)total_size)
total_size += sTHX;
else
- Perl_croak_nocontext(PL_memory_wrap);
+ Perl_croak_nocontext("%s", PL_memory_wrap);
#endif
#ifdef HAS_64K_LIMIT
if (total_size > 0xffff) {
End of Patch.