summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2013-05-09 14:23:38 +0100
committerDavid Mitchell <davem@iabyn.com>2013-05-09 14:34:00 +0100
commit9a9b5ec9e94e1e207c265a6acd160fc49bca06fa (patch)
tree6d172543e9d62b5ce6dd790ada6130c3bdeae0c7
parent3231f5793f6a3d7ee78eb1d68feb05c064b33315 (diff)
downloadperl-9a9b5ec9e94e1e207c265a6acd160fc49bca06fa.tar.gz
silence warnings under NO_TAINT_SUPPORT
The are lots of places where local vars aren't used when compiled with NO_TAINT_SUPPORT.
-rw-r--r--doio.c2
-rw-r--r--hv.c5
-rw-r--r--mg.c3
-rw-r--r--op.c5
-rw-r--r--pp_ctl.c3
-rw-r--r--pp_hot.c6
-rw-r--r--scope.c4
-rw-r--r--taint.c7
-rw-r--r--util.c5
9 files changed, 36 insertions, 4 deletions
diff --git a/doio.c b/doio.c
index 56c10198b1..2d65d547a0 100644
--- a/doio.c
+++ b/doio.c
@@ -1589,6 +1589,8 @@ Perl_apply(pTHX_ I32 type, SV **mark, SV **sp)
PERL_ARGS_ASSERT_APPLY;
+ PERL_UNUSED_VAR(what); /* may not be used depending on compile options */
+
/* Doing this ahead of the switch statement preserves the old behaviour,
where attempting to use kill as a taint test test would fail on
platforms where kill was not defined. */
diff --git a/hv.c b/hv.c
index 76b0a8cd4e..6476f5171a 100644
--- a/hv.c
+++ b/hv.c
@@ -526,7 +526,7 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
bool needs_store;
hv_magic_check (hv, &needs_copy, &needs_store);
if (needs_copy) {
- const bool save_taint = TAINT_get; /* Unused var warning under NO_TAINT_SUPPORT */
+ const bool save_taint = TAINT_get;
if (keysv || is_utf8) {
if (!keysv) {
keysv = newSVpvn_utf8(key, klen, TRUE);
@@ -540,6 +540,9 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
}
TAINT_IF(save_taint);
+#ifdef NO_TAINT_SUPPORT
+ PERL_UNUSED_VAR(save_taint);
+#endif
if (!needs_store) {
if (flags & HVhek_FREEKEY)
Safefree(key);
diff --git a/mg.c b/mg.c
index 6811727206..c3dc4ddd18 100644
--- a/mg.c
+++ b/mg.c
@@ -2220,6 +2220,9 @@ Perl_magic_gettaint(pTHX_ SV *sv, MAGIC *mg)
PERL_ARGS_ASSERT_MAGIC_GETTAINT;
PERL_UNUSED_ARG(sv);
+#ifdef NO_TAINT_SUPPORT
+ PERL_UNUSED_ARG(mg);
+#endif
TAINT_IF((PL_localizing != 1) && (mg->mg_len & 1));
return 0;
diff --git a/op.c b/op.c
index a46d68b181..8457869bce 100644
--- a/op.c
+++ b/op.c
@@ -9103,9 +9103,12 @@ Perl_ck_index(pTHX_ OP *o)
if (kid)
kid = kid->op_sibling; /* get past "big" */
if (kid && kid->op_type == OP_CONST) {
- const bool save_taint = TAINT_get; /* accepted unused var warning if NO_TAINT_SUPPORT */
+ const bool save_taint = TAINT_get;
fbm_compile(((SVOP*)kid)->op_sv, 0);
TAINT_set(save_taint);
+#ifdef NO_TAINT_SUPPORT
+ PERL_UNUSED_VAR(save_taint);
+#endif
}
}
return ck_fun(o);
diff --git a/pp_ctl.c b/pp_ctl.c
index 0b8ab98e12..07d1d9fc1b 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -153,6 +153,9 @@ PP(pp_regcomp)
modified by get-magic), to avoid incorrectly setting the
RXf_TAINTED flag with RX_TAINT_on further down. */
TAINT_set(was_tainted);
+#if NO_TAINT_SUPPORT
+ PERL_UNUSED_VAR(was_tainted);
+#endif
}
tmp = reg_temp_copy(NULL, new_re);
ReREFCNT_dec(new_re);
diff --git a/pp_hot.c b/pp_hot.c
index 361b488124..dd9e5f15be 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1243,6 +1243,12 @@ PP(pp_aassign)
tmp_egid = PerlProc_getegid();
}
TAINTING_set( TAINTING_get | (tmp_uid && (tmp_euid != tmp_uid || tmp_egid != tmp_gid)) );
+#ifdef NO_TAINT_SUPPORT
+ PERL_UNUSED_VAR(tmp_uid);
+ PERL_UNUSED_VAR(tmp_euid);
+ PERL_UNUSED_VAR(tmp_gid);
+ PERL_UNUSED_VAR(tmp_egid);
+#endif
}
PL_delaymagic = 0;
diff --git a/scope.c b/scope.c
index 4f9d771f95..abfd539b49 100644
--- a/scope.c
+++ b/scope.c
@@ -916,7 +916,9 @@ Perl_leave_scope(pTHX_ I32 base)
break;
case SAVEt_BOOL: /* bool reference */
*(bool*)ARG0_PTR = cBOOL(uv >> 8);
-#if !NO_TAINT_SUPPORT
+#ifdef NO_TAINT_SUPPORT
+ PERL_UNUSED_VAR(was);
+#else
if (ARG0_PTR == &(TAINT_get)) {
/* If we don't update <was>, to reflect what was saved on the
* stack for PL_tainted, then we will overwrite this attempt to
diff --git a/taint.c b/taint.c
index 4ebba5bc4a..fab98ec2ce 100644
--- a/taint.c
+++ b/taint.c
@@ -110,6 +110,9 @@ Perl_taint_env(pTHX)
taint_proper("%%ENV is aliased to %%%s%s", name);
/* this statement is reached under -t or -U */
TAINT_set(was_tainted);
+#ifdef NO_TAINT_SUPPORT
+ PERL_UNUSED_VAR(was_tainted);
+#endif
}
#ifdef VMS
@@ -157,7 +160,11 @@ Perl_taint_env(pTHX)
const bool was_tainted = TAINT_get;
const char *t = SvPV_const(*svp, len);
const char * const e = t + len;
+
TAINT_set(was_tainted);
+#ifdef NO_TAINT_SUPPORT
+ PERL_UNUSED_VAR(was_tainted);
+#endif
if (t < e && isWORDCHAR(*t))
t++;
while (t < e && (isWORDCHAR(*t) || strchr("-_.+", *t)))
diff --git a/util.c b/util.c
index ec9cc5e74f..da5959f65c 100644
--- a/util.c
+++ b/util.c
@@ -6423,7 +6423,7 @@ Perl_get_db_sub(pTHX_ SV **svp, CV *cv)
{
dVAR;
SV * const dbsv = GvSVn(PL_DBsub);
- const bool save_taint = TAINT_get; /* Accepted unused var warning under NO_TAINT_SUPPORT */
+ const bool save_taint = TAINT_get;
/* When we are called from pp_goto (svp is null),
* we do not care about using dbsv to call CV;
@@ -6474,6 +6474,9 @@ Perl_get_db_sub(pTHX_ SV **svp, CV *cv)
SvIV_set(dbsv, PTR2IV(cv)); /* Do it the quickest way */
}
TAINT_IF(save_taint);
+#ifdef NO_TAINT_SUPPORT
+ PERL_UNUSED_VAR(save_taint);
+#endif
}
int