regex: avoid new dead-code warning with gcc-4.6.0
authorJim Meyering <meyering@redhat.com>
Mon, 7 Jun 2010 05:58:49 +0000 (07:58 +0200)
committerJim Meyering <meyering@redhat.com>
Mon, 7 Jun 2010 05:58:49 +0000 (07:58 +0200)
* 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.

ChangeLog
lib/regex_internal.c

index 29475fab774e98fc468232d21d5943882a768d99..845bc6e25f3b2ae9b5089938abc5fe30dbbbab86 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-07  Jim Meyering  <meyering@redhat.com>
+
+       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  <bruno@clisp.org>
 
        * doc/posix-functions/strcoll.texi: Mention Solaris limitation.
index 378b767d8228ad7750d27f815a9a37dbd88dfb63..787a3a62754d49178889d39bc9cae0e35d9dd6ef 100644 (file)
@@ -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));