diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-09-07 10:49:53 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-09-07 10:49:53 +0300 |
commit | 48c8fc07cc35539aa171116d0b77a6a47336b6fe (patch) | |
tree | 8573a3bf40b151d47ca0291ec666a6730b248a59 /support | |
parent | 2da381d8f9b1638fbd31308edb17406bcf8ccee2 (diff) | |
download | egawk-48c8fc07cc35539aa171116d0b77a6a47336b6fe.tar.gz egawk-48c8fc07cc35539aa171116d0b77a6a47336b6fe.tar.bz2 egawk-48c8fc07cc35539aa171116d0b77a6a47336b6fe.zip |
Update misc files from GNULIB.
Diffstat (limited to 'support')
-rw-r--r-- | support/ChangeLog | 4 | ||||
-rw-r--r-- | support/intprops.h | 16 | ||||
-rw-r--r-- | support/verify.h | 3 |
3 files changed, 15 insertions, 8 deletions
diff --git a/support/ChangeLog b/support/ChangeLog index 24cbcfeb..99483518 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,3 +1,7 @@ +2018-09-07 Arnold D. Robbins <arnold@skeeve.com> + + * intprops.h, verify.h: Updated from GNULIB. + 2018-08-26 Arnold D. Robbins <arnold@skeeve.com> * regex_internal.c: Sync with GNULIB. diff --git a/support/intprops.h b/support/intprops.h index af456ff5..a4be30b8 100644 --- a/support/intprops.h +++ b/support/intprops.h @@ -22,12 +22,13 @@ #include <limits.h> -/* 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)) +/* Return a value with the common real type of E and V and the value of V. + Do not evaluate E. */ +#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v)) /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */ -#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v)) +#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v)) /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ @@ -40,13 +41,14 @@ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* Return 1 if the real expression E, after promotion, has a - signed or floating type. */ + signed or floating type. Do not evaluate E. */ #define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) /* Minimum and maximum values for integer types and expressions. */ /* The width in bits of the integer type or expression T. + Do not evaluate T. Padding bits are not supported; this is checked at compile-time below. */ #define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) @@ -58,7 +60,7 @@ : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) /* The maximum and minimum values for the type of the expression E, - after integer promotion. E should not have side effects. */ + after integer promotion. E is not evaluated. */ #define _GL_INT_MINIMUM(e) \ (EXPR_SIGNED (e) \ ? ~ _GL_SIGNED_INT_MAXIMUM (e) \ @@ -340,8 +342,8 @@ Arguments should be free of side effects. */ #define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \ op_result_overflow (a, b, \ - _GL_INT_MINIMUM (0 * (b) + (a)), \ - _GL_INT_MAXIMUM (0 * (b) + (a))) + _GL_INT_MINIMUM ((1 ? 0 : (b)) + (a)), \ + _GL_INT_MAXIMUM ((1 ? 0 : (b)) + (a))) /* Store the low-order bits of A + B, A - B, A * B, respectively, into *R. Return 1 if the result overflows. See above for restrictions. */ diff --git a/support/verify.h b/support/verify.h index bc7f99db..3b57ddee 100644 --- a/support/verify.h +++ b/support/verify.h @@ -276,7 +276,8 @@ template <int w> when 'assume' silences warnings even with older GCCs. */ # define assume(R) ((R) ? (void) 0 : __builtin_trap ()) #else -# define assume(R) ((void) (0 && (R))) + /* Some tools grok NOTREACHED, e.g., Oracle Studio 12.6. */ +# define assume(R) ((R) ? (void) 0 : /*NOTREACHED*/ (void) 0) #endif /* @assert.h omit end@ */ |