From patchwork Fri Dec 8 09:16:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnold Robbins X-Patchwork-Id: 24806 Received: (qmail 102125 invoked by alias); 8 Dec 2017 09:21:56 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 102048 invoked by uid 89); 8 Dec 2017 09:21:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, MANY_HDRS_LCASE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=HContent-type:text, Hx-spam-relays-external:ESMTPA X-HELO: mxout4.netvision.net.il MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII From: Arnold Robbins Message-id: <201712080916.vB89GxuG005497@skeeve.com> Date: Fri, 08 Dec 2017 11:16:59 +0200 To: carlos@redhat.com, libc-alpha@sourceware.org Subject: [PATCH 04/17] Regex: Fix use of or add RE_ENABLE_I18N. User-Agent: Heirloom mailx 12.5 6/20/10 This patch makes better use of RE_ENABLE_I18N so that variables needed only in that case are not declared otherwise. This avoids "unused variable" warnings from various compilers. 2017-11-27 Arnold D. Robbins * posix/regex_internal.c (re_string_reconstruct): Fix use of and/or add #ifdef RE_ENABLE_I18N. * posix/regexec.c (check_arrival_add_next_nodes): Ditto. diff --git a/posix/regex_internal.c b/posix/regex_internal.c index a97f703..705d6a4 100644 --- a/posix/regex_internal.c +++ b/posix/regex_internal.c @@ -681,10 +681,10 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags) } else { +#ifdef RE_ENABLE_I18N /* No, skip all characters until IDX. */ int prev_valid_len = pstr->valid_len; -#ifdef RE_ENABLE_I18N if (BE (pstr->offsets_needed, 0)) { pstr->len = pstr->raw_len - idx + offset; diff --git a/posix/regexec.c b/posix/regexec.c index 1290576..a0d9736 100644 --- a/posix/regexec.c +++ b/posix/regexec.c @@ -2990,7 +2990,9 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, int str_idx, const re_dfa_t *const dfa = mctx->dfa; int result; int cur_idx; +#ifdef RE_ENABLE_I18N reg_errcode_t err = REG_NOERROR; +#endif re_node_set union_set; re_node_set_init_empty (&union_set); for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx)