diff options
author | David Mitchell <davem@iabyn.com> | 2013-05-09 14:23:38 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-05-09 14:34:00 +0100 |
commit | 9a9b5ec9e94e1e207c265a6acd160fc49bca06fa (patch) | |
tree | 6d172543e9d62b5ce6dd790ada6130c3bdeae0c7 | |
parent | 3231f5793f6a3d7ee78eb1d68feb05c064b33315 (diff) | |
download | perl-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.c | 2 | ||||
-rw-r--r-- | hv.c | 5 | ||||
-rw-r--r-- | mg.c | 3 | ||||
-rw-r--r-- | op.c | 5 | ||||
-rw-r--r-- | pp_ctl.c | 3 | ||||
-rw-r--r-- | pp_hot.c | 6 | ||||
-rw-r--r-- | scope.c | 4 | ||||
-rw-r--r-- | taint.c | 7 | ||||
-rw-r--r-- | util.c | 5 |
9 files changed, 36 insertions, 4 deletions
@@ -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. */ @@ -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); @@ -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; @@ -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); @@ -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); @@ -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; @@ -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 @@ -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))) @@ -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 |