On 9/17/20 7:52 AM, Jeffrey Walton wrote:

grep-3.4-almost.19-ff30 fails to build on Ubuntu 4, triplet i686-pc-linux-gnu.

I installed the attached patch to Gnulib, which I hope works around this issue once grep is updated to the latest Gnulib. cc'ing to bug-gnulib.

The comment in the old version didn't match the code (glibc has the same mismatch). This patch updates the comment to match the new code.
>From 8125325281a491de9e0a6edc3c4d40d77c026114 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Thu, 17 Sep 2020 09:45:21 -0700
Subject: [PATCH] libc-config: port __THROW to Ubuntu 4
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lib/cdefs.h (__THROW): Do not use __attribute__ ((__nothrow__))
for GCC 3.3.  Problem reported by Jeffrey Walton in:
https://lists.gnu.org/r/bug-gnulib/2019-07/msg00058.html
The GCC 3.3.4 documentation says the attribute should work, but
apparently it does not work on Ubuntu 4’s GCC 3.3.  There seems
little point or desire to research this circa-2004 platform further,
so just avoid the attribute there.
---
 ChangeLog   | 11 +++++++++++
 lib/cdefs.h |  4 ++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e5b50bf55..b484c8dec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2020-09-17  Paul Eggert  <egg...@cs.ucla.edu>
+
+	libc-config: port __THROW to Ubuntu 4
+	* lib/cdefs.h (__THROW): Do not use __attribute__ ((__nothrow__))
+	for GCC 3.3.  Problem reported by Jeffrey Walton in:
+	https://lists.gnu.org/r/bug-gnulib/2019-07/msg00058.html
+	The GCC 3.3.4 documentation says the attribute should work, but
+	apparently it does not work on Ubuntu 4’s GCC 3.3.  There seems
+	little point or desire to research this circa-2004 platform further,
+	so just avoid the attribute there.
+
 2020-09-17  Jim Meyering  <meyer...@fb.com>
 
 	test-dfa-match.sh: port timeout work-around to newer Busybox
diff --git a/lib/cdefs.h b/lib/cdefs.h
index 1ae9ffc77..b4ac4df66 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -75,11 +75,11 @@
 
 /* GCC can always grok prototypes.  For C++ programs we add throw()
    to help it optimize the function calls.  But this works only with
-   gcc 2.8.x and egcs.  For gcc 3.2 and up we even mark C functions
+   gcc 2.8.x and egcs.  For gcc 3.4 and up we even mark C functions
    as non-throwing using a function attribute since programs can use
    the -fexceptions options for C code as well.  */
 # if !defined __cplusplus \
-     && (__GNUC_PREREQ (3, 3) || __glibc_clang_has_attribute (__nothrow__))
+     && (__GNUC_PREREQ (3, 4) || __glibc_clang_has_attribute (__nothrow__))
 #  define __THROW	__attribute__ ((__nothrow__ __LEAF))
 #  define __THROWNL	__attribute__ ((__nothrow__))
 #  define __NTH(fct)	__attribute__ ((__nothrow__ __LEAF)) fct
-- 
2.17.1

Reply via email to