grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v2.18-82-gee163d8


From: Paul Eggert
Subject: grep branch, master, updated. v2.18-82-gee163d8
Date: Sat, 19 Apr 2014 06:18:12 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  ee163d8f5ae541bdaab0f2d23826c7e4e275846b (commit)
      from  f08497935213250eb1aba9604a5418f2f7c41880 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=ee163d8f5ae541bdaab0f2d23826c7e4e275846b


commit ee163d8f5ae541bdaab0f2d23826c7e4e275846b
Author: Paul Eggert <address@hidden>
Date:   Fri Apr 18 23:17:41 2014 -0700

    dfa: fix pointer type conversion bug
    
    The code converted between size_t * and ptrdiff_t *, which wasn't
    diagnosed by modern x86-64 GCC but isn't portable.  Problem
    reported by Norihiro Tanaka in <http://bugs.gnu.org/17136#31>.
    * configure.ac (WERROR_CFLAGS): Don't add -Wno-pointer-sign.
    We want GCC to diagnose pointer signedness problems, as they
    violate the C standard and other compilers no doubt complain too.
    * src/dfa.c (struct dfa): Change type of salloc to size_t.
    (realloc_trans_if_necessary): Convert signed value to size_t before
    passing its address to x2nrealloc.  Changing the type of tralloc
    to size_t might have led to problems elsewhere.

diff --git a/configure.ac b/configure.ac
index 886449b..17a8920 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,7 +145,6 @@ if test "$gl_gcc_warnings" = yes; then
   done
   gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
   gl_WARN_ADD([-Wno-sign-compare])     # Too many warnings for now
-  gl_WARN_ADD([-Wno-pointer-sign])     # Too many warnings for now
   gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
 
   # In spite of excluding -Wlogical-op above, it is enabled, as of
diff --git a/src/dfa.c b/src/dfa.c
index eeca257..90cf4a9 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -378,7 +378,7 @@ struct dfa
   /* Fields filled by the state builder.  */
   dfa_state *states;            /* States of the dfa.  */
   state_num sindex;             /* Index for adding new states.  */
-  state_num salloc;             /* Number of states currently allocated.  */
+  size_t salloc;               /* Number of states currently allocated.  */
 
   /* Fields filled by the parse tree->NFA conversion.  */
   position_set *follows;        /* Array of follow sets, indexed by position
@@ -2780,12 +2780,12 @@ realloc_trans_if_necessary (struct dfa *d, state_num 
new_state)
   if (oldalloc <= new_state)
     {
       state_num **realtrans = d->trans ? d->trans - 1 : NULL;
-      size_t newalloc;
-      d->tralloc = new_state + 1;
-      realtrans = x2nrealloc (realtrans, &d->tralloc, sizeof *realtrans);
+      size_t newalloc, newalloc1;
+      newalloc1 = new_state + 1;
+      realtrans = x2nrealloc (realtrans, &newalloc1, sizeof *realtrans);
       realtrans[0] = NULL;
       d->trans = realtrans + 1;
-      newalloc = --d->tralloc;
+      d->tralloc = newalloc = newalloc1 - 1;
       d->fails = xnrealloc (d->fails, newalloc, sizeof *d->fails);
       d->success = xnrealloc (d->success, newalloc, sizeof *d->success);
       d->newlines = xnrealloc (d->newlines, newalloc, sizeof *d->newlines);

-----------------------------------------------------------------------

Summary of changes:
 configure.ac |    1 -
 src/dfa.c    |   10 +++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]