Re: regex problems

2005-08-20 Thread Paul Eggert
Sam Steingold [EMAIL PROTECTED] writes:

 Would you please also consider the 2 patches in
 http://article.gmane.org/gmane.comp.lib.gnulib.bugs:3996

OK, I installed the first patch, as follows:

2005-08-20  Paul Eggert  [EMAIL PROTECTED]

* config/srclist.txt: Add glibc bug 1226.
* lib/regex_internal.c (calc_state_hash): Put 'inline' before type,
since some compilers warn about it otherwise.

--- config/srclist.txt  21 Aug 2005 00:43:34 -  1.76
+++ config/srclist.txt  21 Aug 2005 03:30:38 -
@@ -111,6 +111,7 @@ $LIBCSRC/posix/regex.c  lib gpl
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1215
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1218
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1220
+# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1226
 #$LIBCSRC/posix/regex_internal.c   lib gpl
 #
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1054
--- lib/regex_internal.c20 Aug 2005 07:42:15 -  1.4
+++ lib/regex_internal.c21 Aug 2005 03:30:38 -
@@ -34,7 +34,7 @@ static re_dfastate_t *create_cd_newstate
  const re_node_set *nodes,
  unsigned int context,
  unsigned int hash) internal_function;
-static unsigned int inline calc_state_hash (const re_node_set *nodes,
+static inline unsigned int calc_state_hash (const re_node_set *nodes,
unsigned int context) 
internal_function;
 
 /* Functions for string operation.  */
@@ -1353,7 +1353,7 @@ re_dfa_add_node (re_dfa_t *dfa, re_token
   return dfa-nodes_len++;
 }
 
-static unsigned int inline
+static inline unsigned int
 internal_function
 calc_state_hash (const re_node_set *nodes, unsigned int context)
 {


___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib


Re: regex problems

2005-08-20 Thread Paul Eggert
Sam Steingold [EMAIL PROTECTED] writes:

 Would you please also consider the 2 patches in
 http://article.gmane.org/gmane.comp.lib.gnulib.bugs:3996

Thanks for reporting those.  I installed the first patch as I
described earlier.  The second patch is not correct, though, so I
installed the following instead (and reported the bug to glibc):

2005-08-20  Paul Eggert  [EMAIL PROTECTED]

* config/srclist.txt: Add glibc bug 1227.
* lib/regexec.c (sift_states_bkref): Fix portability bug: the code
assumed that reg_errcode_t is a signed type, which is not
necessarily true if _XOPEN_SOURCE is not defined.

--- config/srclist.txt  21 Aug 2005 03:31:46 -  1.77
+++ config/srclist.txt  21 Aug 2005 05:00:31 -
@@ -121,6 +121,7 @@ $LIBCSRC/posix/regex.c  lib gpl
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1216
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1220
 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1225
+# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1227
 #$LIBCSRC/posix/regexec.c  lib gpl
 #
 # c89 changes $LIBCSRC/string/strdup.c lib gpl
--- lib/regexec.c   21 Aug 2005 00:43:34 -  1.4
+++ lib/regexec.c   21 Aug 2005 05:00:32 -
@@ -2088,7 +2088,7 @@ sift_states_bkref (re_match_context_t *m
   enabled_idx = first_idx;
   do
{
- int subexp_len, to_idx, dst_node;
+ int subexp_len, to_idx, dst_node, ret;
  re_dfastate_t *cur_state;
 
  if (entry-node != node)
@@ -2114,8 +2114,8 @@ sift_states_bkref (re_match_context_t *m
}
  local_sctx.last_node = node;
  local_sctx.last_str_idx = str_idx;
- err = re_node_set_insert (local_sctx.limits, enabled_idx);
- if (BE (err  0, 0))
+ ret = re_node_set_insert (local_sctx.limits, enabled_idx);
+ if (BE (ret  0, 0))
{
  err = REG_ESPACE;
  goto free_return;


___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib


Re: regex problems

2005-08-05 Thread Sam Steingold
 * Bruno Haible [EMAIL PROTECTED] [2005-08-04 13:22:12 +0200]:

 Sam Steingold wrote:
  This patch should work. ...

 will you check this into the gnulib CVS?

 I'm waiting for other people's opinion, especially Paul Eggert's one.
 (The regex module is owned by all.)

here are 2 more issues:

1. warning:

In file included from regex.c:85:
regex_internal.c:37: warning: `inline' is not at beginning of declaration
regex_internal.c:1381: warning: `inline' is not at beginning of declaration

fixed by:

--- regex_internal.c07 Jul 2005 04:08:39 -0400  1.1
+++ regex_internal.c05 Aug 2005 11:17:06 -0400  
@@ -34,7 +34,7 @@
  const re_node_set *nodes,
  unsigned int context,
  unsigned int hash) internal_function;
-static unsigned int inline calc_state_hash (const re_node_set *nodes,
+static inline unsigned int calc_state_hash (const re_node_set *nodes,
unsigned int context) 
internal_function;
 
 /* Functions for string operation.  */
@@ -1378,7 +1378,7 @@
   return dfa-nodes_len++;
 }
 
-static unsigned int inline
+static inline unsigned int
 calc_state_hash (nodes, context)
  const re_node_set *nodes;
  unsigned int context;

2. warning:

In file included from regex.c:87:
regexec.c: In function `sift_states_bkref':
regexec.c:2162: warning: comparison of unsigned expression  0 is always false

fixed by

--- regexec.c   07 Jul 2005 04:08:39 -0400  1.1
+++ regexec.c   05 Aug 2005 11:22:35 -0400  
@@ -2159,7 +2159,7 @@
  local_sctx.last_node = node;
  local_sctx.last_str_idx = str_idx;
  err = re_node_set_insert (local_sctx.limits, enabled_idx);
- if (BE (err  0, 0))
+ if (BE (err != REG_NOERROR, 0))
{
  err = REG_ESPACE;
  goto free_return;



  Does the definition of AC_CHECK_HEADERS_ONCE also find its way into
  the aclocal.m4 file? ...
 no, aclocal.m4 does not have the definition.
 That's the problem. Fix that, and it will work.
how do you fix it?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
http://ffii.org/ http://www.dhimmi.com/ http://www.iris.org.il
http://www.mideasttruth.com/ http://www.honestreporting.com
If You Want Breakfast In Bed, Sleep In the Kitchen.



___
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib