John E. Malmberg wrote:
The macro _GL_INT_OPT_WRAPV_LONGISH has one more right parenthesis on it than
left parenthesis.

Ah, sorry, that wasn't obvious in the original bug report. I installed the attached further patch. Apparently this part of the code has never been exercised on any platform before (which means you get to be the brave adventurer :-). It's not often we run into a platform lacking decent 'long long' support these days.
>From 6bd4be58b307b44db2ebc46e9b01c10f65eb83e7 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Wed, 24 Aug 2016 22:24:48 -0700
Subject: [PATCH] intprops: fix paren typo on old platforms

Problem reported by John E. Malmberg in: https://bugs.gnu.org/24300#13
* lib/intprops.h (_GL_INT_OP_WRAPV_LONGISH)
[__GNUC__ < 5 && !__has_builtin (__builtin_add_overflow)
&& (__STDC_VERSION__ < 201112 || _GL__GENERIC_BOGUS)
&& !defined LLONG_MAX]:
Remove stray paren.
---
 ChangeLog      | 8 ++++++++
 lib/intprops.h | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 7cfd244..4a2e641 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2016-08-24  Paul Eggert  <egg...@cs.ucla.edu>
 
+	intprops: fix paren typo on old platforms
+	Problem reported by John E. Malmberg in: https://bugs.gnu.org/24300#13
+	* lib/intprops.h (_GL_INT_OP_WRAPV_LONGISH)
+	[__GNUC__ < 5 && !__has_builtin (__builtin_add_overflow)
+	&& (__STDC_VERSION__ < 201112 || _GL__GENERIC_BOGUS)
+	&& !defined LLONG_MAX]:
+	Remove stray paren.
+
 	intprops: port to OpenVMS
 	Problem reported by John E. Malmberg in: https://bugs.gnu.org/24300
 	* doc/posix-headers/limits.texi: Document the problem.
diff --git a/lib/intprops.h b/lib/intprops.h
index fe6c789..6030760 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -418,7 +418,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
 # else
 #  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
     _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
-                     long int, LONG_MIN, LONG_MAX))
+                     long int, LONG_MIN, LONG_MAX)
 # endif
 #endif
 
-- 
2.7.4

Reply via email to