summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2014-05-31 01:15:42 +0200
committerBrian Fraser <fraserbn@gmail.com>2014-06-13 00:00:32 +0200
commitc1f6cd3988b31cd34ffa1d026b424ee13ea91c3e (patch)
tree8154c915a780bac466e127aa87aa7b5119ec35e8
parent10bafe900712959ffc221cebb2efefdd192d152f (diff)
downloadperl-c1f6cd3988b31cd34ffa1d026b424ee13ea91c3e.tar.gz
Adding missing SVfARG() invocations
This silences a chunk of warnings under -Wformat
-rw-r--r--mro.c2
-rw-r--r--op.c20
-rw-r--r--pad.c10
-rw-r--r--perl.c10
-rw-r--r--pp.c2
-rw-r--r--pp_hot.c4
-rw-r--r--sv.c2
-rw-r--r--toke.c2
-rw-r--r--util.c15
9 files changed, 34 insertions, 33 deletions
diff --git a/mro.c b/mro.c
index 76230baee8..bd62e9da08 100644
--- a/mro.c
+++ b/mro.c
@@ -960,7 +960,7 @@ S_mro_gather_and_rename(pTHX_ HV * const stashes, HV * const seen_stashes,
const char *name = SvPVx_const(*svp, len);
if(PL_stashcache) {
DEBUG_o(Perl_deb(aTHX_ "mro_gather_and_rename clearing PL_stashcache for '%"SVf"'\n",
- *svp));
+ SVfARG(*svp)));
(void)hv_delete(PL_stashcache, name, name_utf8 ? -(I32)len : (I32)len, G_DISCARD);
}
++svp;
diff --git a/op.c b/op.c
index 193189bf69..c3cfa6c580 100644
--- a/op.c
+++ b/op.c
@@ -511,7 +511,7 @@ STATIC OP *
S_too_few_arguments_sv(pTHX_ OP *o, SV *namesv, U32 flags)
{
PERL_ARGS_ASSERT_TOO_FEW_ARGUMENTS_SV;
- yyerror_pv(Perl_form(aTHX_ "Not enough arguments for %"SVf, namesv),
+ yyerror_pv(Perl_form(aTHX_ "Not enough arguments for %"SVf, SVfARG(namesv)),
SvUTF8(namesv) | flags);
return o;
}
@@ -1272,8 +1272,8 @@ S_scalar_slice_warning(pTHX_ const OP *o)
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
"Scalar value @%"SVf"%c%"SVf"%c better written as $%"
SVf"%c%"SVf"%c",
- SVfARG(name), lbrack, keysv, rbrack,
- SVfARG(name), lbrack, keysv, rbrack);
+ SVfARG(name), lbrack, SVfARG(keysv), rbrack,
+ SVfARG(name), lbrack, SVfARG(keysv), rbrack);
}
OP *
@@ -1375,8 +1375,8 @@ Perl_scalar(pTHX_ OP *o)
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
"%%%"SVf"%c%"SVf"%c in scalar context better "
"written as $%"SVf"%c%"SVf"%c",
- SVfARG(name), lbrack, keysv, rbrack,
- SVfARG(name), lbrack, keysv, rbrack);
+ SVfARG(name), lbrack, SVfARG(keysv), rbrack,
+ SVfARG(name), lbrack, SVfARG(keysv), rbrack);
}
}
return o;
@@ -1590,7 +1590,7 @@ Perl_scalarvoid(pTHX_ OP *o)
SvREFCNT_dec_NN(dsv);
}
else if (SvOK(sv)) {
- useless_sv = Perl_newSVpvf(aTHX_ "a constant (%"SVf")", sv);
+ useless_sv = Perl_newSVpvf(aTHX_ "a constant (%"SVf")", SVfARG(sv));
}
else
useless = "a constant (undef)";
@@ -1723,7 +1723,7 @@ Perl_scalarvoid(pTHX_ OP *o)
/* mortalise it, in case warnings are fatal. */
Perl_ck_warner(aTHX_ packWARN(WARN_VOID),
"Useless use of %"SVf" in void context",
- sv_2mortal(useless_sv));
+ SVfARG(sv_2mortal(useless_sv)));
}
else if (useless) {
Perl_ck_warner(aTHX_ packWARN(WARN_VOID),
@@ -3034,7 +3034,7 @@ Perl_bind_match(pTHX_ I32 type, OP *left, OP *right)
if (name)
Perl_warner(aTHX_ packWARN(WARN_MISC),
"Applying %s to %"SVf" will act on scalar(%"SVf")",
- desc, name, name);
+ desc, SVfARG(name), SVfARG(name));
else {
const char * const sample = (isary
? "@array" : "%hash");
@@ -11130,7 +11130,7 @@ Perl_ck_length(pTHX_ OP *o)
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
"length() used on %"SVf" (did you mean \"scalar(%s%"SVf
")\"?)",
- name, hash ? "keys " : "", name
+ SVfARG(name), hash ? "keys " : "", SVfARG(name)
);
else if (hash)
/* diag_listed_as: length() used on %s (did you mean "scalar(%s)"?) */
@@ -12577,7 +12577,7 @@ Perl_report_redefined_cv(pTHX_ const SV *name, const CV *old_cv,
is_const
? "Constant subroutine %"SVf" redefined"
: "Subroutine %"SVf" redefined",
- name);
+ SVfARG(name));
}
/*
diff --git a/pad.c b/pad.c
index 31282d157d..e6e8024116 100644
--- a/pad.c
+++ b/pad.c
@@ -904,7 +904,7 @@ S_pad_check_dup(pTHX_ SV *name, U32 flags, const HV *ourstash)
"\"%s\" %s %"SVf" masks earlier declaration in same %s",
(is_our ? "our" : PL_parser->in_my == KEY_my ? "my" : "state"),
*SvPVX(sv) == '&' ? "subroutine" : "variable",
- sv,
+ SVfARG(sv),
(COP_SEQ_RANGE_HIGH(sv) == PERL_PADSEQ_INTRO
? "scope" : "statement"));
--off;
@@ -924,7 +924,7 @@ S_pad_check_dup(pTHX_ SV *name, U32 flags, const HV *ourstash)
&& sv_eq(name, sv))
{
Perl_warner(aTHX_ packWARN(WARN_MISC),
- "\"our\" variable %"SVf" redeclared", sv);
+ "\"our\" variable %"SVf" redeclared", SVfARG(sv));
if ((I32)off <= PL_comppad_name_floor)
Perl_warner(aTHX_ packWARN(WARN_MISC),
"\t(Did you mean \"local\" instead of \"our\"?)\n");
@@ -1147,7 +1147,7 @@ S_unavailable(pTHX_ SV *namesv)
*SvPVX_const(namesv) == '&'
? "Subroutin"
: "Variabl",
- namesv);
+ SVfARG(namesv));
}
STATIC PADOFFSET
@@ -1287,9 +1287,9 @@ S_pad_findlex(pTHX_ const char *namepv, STRLEN namelen, U32 flags, const CV* cv,
newwarn = 0;
Perl_warner(aTHX_ packWARN(WARN_CLOSURE),
"Variable \"%"SVf"\" will not stay shared",
- newSVpvn_flags(namepv, namelen,
+ SVfARG(newSVpvn_flags(namepv, namelen,
SVs_TEMP |
- (flags & padadd_UTF8_NAME ? SVf_UTF8 : 0)));
+ (flags & padadd_UTF8_NAME ? SVf_UTF8 : 0))));
}
if (fake_offset && CvANON(cv)
diff --git a/perl.c b/perl.c
index 30b90cd723..544a0bc003 100644
--- a/perl.c
+++ b/perl.c
@@ -2067,8 +2067,8 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
(void)Perl_av_create_and_unshift_one(aTHX_ &PL_preambleav,
Perl_newSVpvf(aTHX_
"BEGIN { do {local $!; -f q%c%"SVf"/buildcustomize.pl%c} and do q%c%"SVf"/buildcustomize.pl%c || die $@ }",
- 0, *inc0, 0,
- 0, *inc0, 0));
+ 0, SVfARG(*inc0), 0,
+ 0, SVfARG(*inc0), 0));
}
# else
/* SITELIB_EXP is a function call on Win32. */
@@ -2081,8 +2081,8 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
(void)Perl_av_create_and_unshift_one(aTHX_ &PL_preambleav,
Perl_newSVpvf(aTHX_
"BEGIN { do {local $!; -f q%c%s/sitecustomize.pl%c} && do q%c%s/sitecustomize.pl%c }",
- 0, sitelib, 0,
- 0, sitelib, 0));
+ 0, SVfARG(sitelib), 0,
+ 0, SVfARG(sitelib), 0));
assert (SvREFCNT(sitelib_sv) == 1);
SvREFCNT_dec(sitelib_sv);
}
@@ -3487,7 +3487,7 @@ S_minus_v(pTHX)
"\nThis is perl " STRINGIFY(PERL_REVISION)
", version " STRINGIFY(PERL_VERSION)
", subversion " STRINGIFY(PERL_SUBVERSION)
- " (%"SVf") built for " ARCHNAME, level
+ " (%"SVf") built for " ARCHNAME, SVfARG(level)
);
SvREFCNT_dec_NN(level);
}
diff --git a/pp.c b/pp.c
index 1d25900aec..2c619ee0d8 100644
--- a/pp.c
+++ b/pp.c
@@ -3367,7 +3367,7 @@ PP(pp_chr)
top = top2;
}
Perl_warner(aTHX_ packWARN(WARN_UTF8),
- "Invalid negative number (%"SVf") in chr", top);
+ "Invalid negative number (%"SVf") in chr", SVfARG(top));
}
value = UNICODE_REPLACEMENT;
} else {
diff --git a/pp_hot.c b/pp_hot.c
index 39586b29c0..fc24abf47f 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -3021,7 +3021,7 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
if (he) {
stash = INT2PTR(HV*,SvIV(HeVAL(he)));
DEBUG_o(Perl_deb(aTHX_ "PL_stashcache hit %p for '%"SVf"'\n",
- stash, sv));
+ (void*)stash, SVfARG(sv)));
goto fetch;
}
@@ -3046,7 +3046,7 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
(void)hv_store(PL_stashcache, packname,
packname_is_utf8 ? -(I32)packlen : (I32)packlen, ref, 0);
DEBUG_o(Perl_deb(aTHX_ "PL_stashcache caching %p for '%"SVf"'\n",
- stash, sv));
+ (void*)stash, SVfARG(sv)));
}
goto fetch;
}
diff --git a/sv.c b/sv.c
index 0a4114b5b0..810eba7b5f 100644
--- a/sv.c
+++ b/sv.c
@@ -6401,7 +6401,7 @@ Perl_sv_clear(pTHX_ SV *const orig_sv)
{
if (PL_stashcache) {
DEBUG_o(Perl_deb(aTHX_ "sv_clear clearing PL_stashcache for '%"SVf"'\n",
- sv));
+ SVfARG(sv)));
(void)hv_deletehek(PL_stashcache,
HvNAME_HEK((HV*)sv), G_DISCARD);
}
diff --git a/toke.c b/toke.c
index ddb5cd49a2..b7a0992c46 100644
--- a/toke.c
+++ b/toke.c
@@ -9600,7 +9600,7 @@ S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, I32 ck_uni)
CopLINE_set(PL_curcop, tmp_copline);
Perl_warner(aTHX_ packWARN(WARN_AMBIGUOUS),
"Ambiguous use of %c{%"SVf"} resolved to %c%"SVf,
- funny, tmp, funny, tmp);
+ funny, SVfARG(tmp), funny, SVfARG(tmp));
CopLINE_set(PL_curcop, orig_copline);
}
}
diff --git a/util.c b/util.c
index 2df60f2766..0005b432ea 100644
--- a/util.c
+++ b/util.c
@@ -5167,10 +5167,10 @@ Perl_xs_version_bootcheck(pTHX_ U32 items, U32 ax, const char *xs_p,
else {
/* XXX GV_ADDWARN */
vn = "XS_VERSION";
- sv = get_sv(Perl_form(aTHX_ "%"SVf"::%s", module, vn), 0);
+ sv = get_sv(Perl_form(aTHX_ "%"SVf"::%s", SVfARG(module), vn), 0);
if (!sv || !SvOK(sv)) {
vn = "VERSION";
- sv = get_sv(Perl_form(aTHX_ "%"SVf"::%s", module, vn), 0);
+ sv = get_sv(Perl_form(aTHX_ "%"SVf"::%s", SVfARG(module), vn), 0);
}
}
if (sv) {
@@ -5181,16 +5181,16 @@ Perl_xs_version_bootcheck(pTHX_ U32 items, U32 ax, const char *xs_p,
if ( vcmp(pmsv,xssv) ) {
SV *string = vstringify(xssv);
SV *xpt = Perl_newSVpvf(aTHX_ "%"SVf" object version %"SVf
- " does not match ", module, string);
+ " does not match ", SVfARG(module), SVfARG(string));
SvREFCNT_dec(string);
string = vstringify(pmsv);
if (vn) {
- Perl_sv_catpvf(aTHX_ xpt, "$%"SVf"::%s %"SVf, module, vn,
- string);
+ Perl_sv_catpvf(aTHX_ xpt, "$%"SVf"::%s %"SVf, SVfARG(module), vn,
+ SVfARG(string));
} else {
- Perl_sv_catpvf(aTHX_ xpt, "bootstrap parameter %"SVf, string);
+ Perl_sv_catpvf(aTHX_ xpt, "bootstrap parameter %"SVf, SVfARG(string));
}
SvREFCNT_dec(string);
@@ -5219,7 +5219,8 @@ Perl_xs_apiversion_bootcheck(pTHX_ SV *module, const char *api_p,
SV *runver_string = vstringify(runver);
xpt = Perl_newSVpvf(aTHX_ "Perl API version %"SVf
" of %"SVf" does not match %"SVf,
- compver_string, module, runver_string);
+ SVfARG(compver_string), SVfARG(module),
+ SVfARG(runver_string));
Perl_sv_2mortal(aTHX_ xpt);
SvREFCNT_dec(compver_string);