changeset 33082:91f899c9bc06

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.
author Jim Meyering <meyering@redhat.com>
date Mon, 07 Jun 2010 07:58:49 +0200
parents dedb4da514a7
children 06a9705792e2
files ChangeLog lib/regex_internal.c
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Jun 05 05:13:57 2010 +0200
+++ b/ChangeLog	Mon Jun 07 07:58:49 2010 +0200
@@ -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.
--- a/lib/regex_internal.c	Sat Jun 05 05:13:57 2010 +0200
+++ b/lib/regex_internal.c	Mon Jun 07 07:58:49 2010 +0200
@@ -733,15 +733,17 @@
 			  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));