gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2561-g394c70


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2561-g394c705
Date: Sun, 21 May 2017 23:20:26 -0400 (EDT)

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 "gawk".

The branch, master has been updated
       via  394c705100366ecea5518ce9cfa0330d495f41b3 (commit)
      from  0f9d4355a03d000938d87d71ba62f0ac2717334a (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.sv.gnu.org/cgit/gawk.git/commit/?id=394c705100366ecea5518ce9cfa0330d495f41b3

commit 394c705100366ecea5518ce9cfa0330d495f41b3
Author: Arnold D. Robbins <address@hidden>
Date:   Mon May 22 06:20:04 2017 +0300

    Update some support files from GNULIB.

diff --git a/support/ChangeLog b/support/ChangeLog
index 1c6015f..e2077bd 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,3 +1,7 @@
+2017-05-22         Arnold D. Robbins     <address@hidden>
+
+       * dfa.c, dfa.h, intprops.h, verify.h: Sync with GNULIB.
+
 2017-03-23         Arnold D. Robbins     <address@hidden>
 
        * dfa.c: Sync with GNULIB.
diff --git a/support/dfa.c b/support/dfa.c
index 2003ac5..18c17a5 100644
--- a/support/dfa.c
+++ b/support/dfa.c
@@ -72,6 +72,14 @@ isasciidigit (char c)
 #include "xalloc.h"
 #include "localeinfo.h"
 
+#ifndef FALLTHROUGH
+# if __GNUC__ < 7
+#  define FALLTHROUGH ((void) 0)
+# else
+#  define FALLTHROUGH __attribute__ ((__fallthrough__))
+# endif
+#endif
+
 #ifndef MIN
 # define MIN(a,b) ((a) < (b) ? (a) : (b))
 #endif
@@ -1661,10 +1669,10 @@ addtok_mb (struct dfa *dfa, token t, char mbprop)
 
     case BACKREF:
       dfa->fast = false;
-      /* fallthrough */
+      FALLTHROUGH;
     default:
       dfa->nleaves++;
-      /* fallthrough */
+      FALLTHROUGH;
     case EMPTY:
       dfa->parse.depth++;
       break;
@@ -2461,8 +2469,7 @@ dfaanalyze (struct dfa *d, bool searchflag)
                 copy (&merged, &d->follows[pos[j].index]);
               }
           }
-          /* fallthrough */
-
+          FALLTHROUGH;
         case QMARK:
           /* A QMARK or STAR node is automatically nullable.  */
           if (d->tokens[i] != PLUS)
@@ -2752,13 +2759,13 @@ build_state (state_num s, struct dfa *d, unsigned char 
uc)
       else if (d->tokens[pos.index] >= CSET)
         {
           matches = d->charclasses[d->tokens[pos.index] - CSET];
-          if (tstbit (uc, &d->charclasses[d->tokens[pos.index] - CSET]))
+          if (tstbit (uc, &matches))
             matched = true;
         }
       else if (d->tokens[pos.index] == ANYCHAR)
         {
           matches = d->charclasses[d->canychar];
-          if (tstbit (uc, &d->charclasses[d->canychar]))
+          if (tstbit (uc, &matches))
             matched = true;
 
           /* ANYCHAR must match with a single character, so we must put
@@ -3378,8 +3385,7 @@ dfa_supported (struct dfa const *d)
         case NOTLIMWORD:
           if (!d->localeinfo.multibyte)
             continue;
-          /* fallthrough */
-
+          FALLTHROUGH;
         case BACKREF:
         case MBCSET:
           return false;
@@ -3488,7 +3494,7 @@ dfassbuild (struct dfa *d)
               sup->tokens[j++] = EMPTY;
               break;
             }
-          /* fallthrough */
+          FALLTHROUGH;
         default:
           sup->tokens[j++] = d->tokens[i];
           if ((0 <= d->tokens[i] && d->tokens[i] < NOTCHAR)
diff --git a/support/dfa.h b/support/dfa.h
index c68b4df..7d11f05 100644
--- a/support/dfa.h
+++ b/support/dfa.h
@@ -1,5 +1,5 @@
 /* dfa.h - declarations for GNU deterministic regexp compiler
-   Copyright (C) 1988, 1998, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1988, 1998, 2007, 2009-2017 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/support/intprops.h b/support/intprops.h
index 716741a..d8c7120 100644
--- a/support/intprops.h
+++ b/support/intprops.h
@@ -1,6 +1,6 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2017 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as published
@@ -21,11 +21,6 @@
 #define _GL_INTPROPS_H
 
 #include <limits.h>
-#include <verify.h>
-
-#ifndef __has_builtin
-# define __has_builtin(x) 0
-#endif
 
 /* Return a value with the common real type of E and V and the value of V.  */
 #define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
@@ -84,24 +79,7 @@
 /* This include file assumes that signed types are two's complement without
    padding bits; the above macros have undefined behavior otherwise.
    If this is a problem for you, please let us know how to fix it for your 
host.
-   As a sanity check, test the assumption for some signed types that
-   <limits.h> bounds.  */
-verify (TYPE_MINIMUM (signed char) == SCHAR_MIN);
-verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
-verify (TYPE_MINIMUM (short int) == SHRT_MIN);
-verify (TYPE_MAXIMUM (short int) == SHRT_MAX);
-verify (TYPE_MINIMUM (int) == INT_MIN);
-verify (TYPE_MAXIMUM (int) == INT_MAX);
-verify (TYPE_MINIMUM (long int) == LONG_MIN);
-verify (TYPE_MAXIMUM (long int) == LONG_MAX);
-#ifdef LLONG_MAX
-verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
-verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
-#endif
-/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined.  */
-#ifdef UINT_WIDTH
-verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
-#endif
+   This assumption is tested by the intprops-tests module.  */
 
 /* Does the __typeof__ keyword work?  This could be done by
    'configure', but for now it's easier to do it by hand.  */
@@ -241,12 +219,10 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
    : (max) >> (b) < (a))
 
 /* True if __builtin_add_overflow (A, B, P) works when P is non-null.  */
-#define _GL_HAS_BUILTIN_OVERFLOW \
-  (5 <= __GNUC__ || __has_builtin (__builtin_add_overflow))
+#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__)
 
 /* True if __builtin_add_overflow_p (A, B, C) works.  */
-#define _GL_HAS_BUILTIN_OVERFLOW_P \
-  (7 <= __GNUC__ || __has_builtin (__builtin_add_overflow_p))
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
 
 /* The _GL*_OVERFLOW macros have the same restrictions as the
    *_RANGE_OVERFLOW macros, except that they do not assume that operands
@@ -395,10 +371,10 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
    (_Generic \
     (*(r), \
      signed char: \
-       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
                         signed char, SCHAR_MIN, SCHAR_MAX), \
      short int: \
-       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
                         short int, SHRT_MIN, SHRT_MAX), \
      int: \
        _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
@@ -412,10 +388,10 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
 #else
 # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
    (sizeof *(r) == sizeof (signed char) \
-    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
+    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
                        signed char, SCHAR_MIN, SCHAR_MAX) \
     : sizeof *(r) == sizeof (short int) \
-    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
+    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
                        short int, SHRT_MIN, SHRT_MAX) \
     : sizeof *(r) == sizeof (int) \
     ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
@@ -437,9 +413,8 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
 
 /* Store the low-order bits of A <op> B into *R, where the operation
    is given by OP.  Use the unsigned type UT for calculation to avoid
-   overflow problems.  *R's type is T, with extremal values TMIN and
-   TMAX.  T must be a signed integer type.  Return 1 if the result
-   overflows.  */
+   overflow problems.  *R's type is T, with extrema TMIN and TMAX.
+   T must be a signed integer type.  Return 1 if the result overflows.  */
 #define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
   (sizeof ((a) op (b)) < sizeof (t) \
    ? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \
@@ -448,17 +423,27 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
   ((overflow (a, b) \
     || (EXPR_SIGNED ((a) op (b)) && ((a) op (b)) < (tmin)) \
     || (tmax) < ((a) op (b))) \
-   ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 1) \
-   : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 0))
-
-/* Return A <op> B, where the operation is given by OP.  Use the
-   unsigned type UT for calculation to avoid overflow problems.
-   Convert the result to type T without overflow by subtracting TMIN
-   from large values before converting, and adding it afterwards.
-   Compilers can optimize all the operations except OP.  */
-#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t, tmin, tmax) \
-  (((ut) (a) op (ut) (b)) <= (tmax) \
-   ? (t) ((ut) (a) op (ut) (b)) \
-   : ((t) (((ut) (a) op (ut) (b)) - (tmin)) + (tmin)))
+   ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \
+   : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0))
+
+/* Return the low-order bits of A <op> B, where the operation is given
+   by OP.  Use the unsigned type UT for calculation to avoid undefined
+   behavior on signed integer overflow, and convert the result to type T.
+   UT is at least as wide as T and is no narrower than unsigned int,
+   T is two's complement, and there is no padding or trap representations.
+   Assume that converting UT to T yields the low-order bits, as is
+   done in all known two's-complement C compilers.  E.g., see:
+   https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html
+
+   According to the C standard, converting UT to T yields an
+   implementation-defined result or signal for values outside T's
+   range.  However, code that works around this theoretical problem
+   runs afoul of a compiler bug in Oracle Studio 12.3 x86.  See:
+   http://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00049.html
+   As the compiler bug is real, don't try to work around the
+   theoretical problem.  */
+
+#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \
+  ((t) ((ut) (a) op (ut) (b)))
 
 #endif /* _GL_INTPROPS_H */
diff --git a/support/verify.h b/support/verify.h
index 5c8381d..dcba9c8 100644
--- a/support/verify.h
+++ b/support/verify.h
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -248,7 +248,12 @@ template <int w>
 /* Verify requirement R at compile-time, as a declaration without a
    trailing ';'.  */
 
-#define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+#ifdef __GNUC__
+# define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+#else
+/* PGI barfs if R is long.  Play it safe.  */
+# define verify(R) _GL_VERIFY (R, "verify (...)")
+#endif
 
 #ifndef __has_builtin
 # define __has_builtin(x) 0

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

Summary of changes:
 support/ChangeLog  |  4 +++
 support/dfa.c      | 24 ++++++++++-------
 support/dfa.h      |  2 +-
 support/intprops.h | 79 ++++++++++++++++++++++--------------------------------
 support/verify.h   |  9 +++++--
 5 files changed, 59 insertions(+), 59 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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