From: Jim Meyering Date: Mon, 7 Jun 2010 05:58:49 +0000 (+0200) Subject: regex: avoid new dead-code warning with gcc-4.6.0 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7873eb96d23bb7d369a0ac6cd5f8e811b0147bfd;p=pspp regex: avoid new dead-code warning with gcc-4.6.0 * lib/regex_internal.c (re_string_reconstruct): #if-0-out a dead if-block containing a while-loop. It's been unused for at least 5 years. --- diff --git a/ChangeLog b/ChangeLog index 29475fab77..845bc6e25f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-06-07 Jim Meyering + + regex: avoid new dead-code warning with gcc-4.6.0 + * lib/regex_internal.c (re_string_reconstruct): #if-0-out a dead + if-block containing a while-loop. It's been unused for at least + 5 years. + 2010-06-05 Bruno Haible * doc/posix-functions/strcoll.texi: Mention Solaris limitation. diff --git a/lib/regex_internal.c b/lib/regex_internal.c index 378b767d82..787a3a6275 100644 --- a/lib/regex_internal.c +++ b/lib/regex_internal.c @@ -733,15 +733,17 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) mbstate_t cur_state; wchar_t wc2; Idx mlen = raw + pstr->len - p; - unsigned char buf[6]; size_t mbclen; +#if 0 /* dead code: buf is set but never used */ + unsigned char buf[6]; if (BE (pstr->trans != NULL, 0)) { int i = mlen < 6 ? mlen : 6; while (--i >= 0) buf[i] = pstr->trans[p[i]]; } +#endif /* XXX Don't use mbrtowc, we know which conversion to use (UTF-8 -> UCS4). */ memset (&cur_state, 0, sizeof (cur_state));