]> Savannah Git Hosting - gnulib.git/commitdiff
libc-config: port __THROW to Ubuntu 4
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Sep 2020 16:45:21 +0000 (09:45 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Sep 2020 16:46:01 +0000 (09:46 -0700)
* 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
lib/cdefs.h

index e5b50bf552e0bbdafc5ab62be071ebec8f8c30f1..b484c8dec4ffe4910b65bc454d1f9158c9703464 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2020-09-17  Paul Eggert  <eggert@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  <meyering@fb.com>
 
        test-dfa-match.sh: port timeout work-around to newer Busybox
index 1ae9ffc7747942743fb58045876dda625b858490..b4ac4df66dd172e83bd5f8f449c1fb6903d62763 100644 (file)
 
 /* 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