diff lib/regcomp.c @ 12848:69c1f6834276

regcomp.c: avoid the sole warning from gcc's -Wtype-limits * lib/regcomp.c (TYPE_SIGNED): Define. (parse_dup_op): Use it to avoid the sole warning from -Wtype-limits.
author Jim Meyering <meyering@redhat.com>
date Wed, 03 Feb 2010 18:01:36 +0100 (2010-02-03)
parents 64dad3a0ba71
children 6240e99d3e0c
line wrap: on
line diff
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -2577,10 +2577,14 @@
   if (BE (tree == NULL, 0))
     goto parse_dup_op_espace;
 
+/* From gnulib's "intprops.h":
+   True if the arithmetic type T is signed.  */
+#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+
   /* This loop is actually executed only when end != REG_MISSING,
      to rewrite <re>{0,n} as (<re>(<re>...<re>?)?)?...  We have
      already created the start+1-th copy.  */
-  if ((Idx) -1 < 0 || end != REG_MISSING)
+  if (TYPE_SIGNED (Idx) || end != REG_MISSING)
     for (i = start + 2; i <= end; ++i)
       {
 	elem = duplicate_tree (elem, dfa);