On 03/27/2014 01:08 PM, Will Newton wrote:
causes a warning with -Wundef which glibc
now enables by default. Rather than updating the conditional it seems
better to just remove it.

If you don't mind I'd like to be a bit more conservative. glibc <sys/cdefs.h> says to use __extension__ only for GCC 2.8 or later, which is still pretty old but if the code's in cdefs.h it might as well be consistent in obstack.h. I pushed the attached patch.
>From 6421fd46004655f39afca254ad02b72ab97f5ecb Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Thu, 27 Mar 2014 13:38:41 -0700
Subject: [PATCH] obstack: Remove ancient NeXTSTEP gcc support conditional

This change will ease merging with glibc.  The "#if ... __NEXT__"
causes a warning with -Wundef which glibc now enables by default.
Problem reported by Will Newton in
<http://lists.gnu.org/archive/html/bug-gnulib/2014-03/msg00032.html>.
glibc <sys/cdefs.h> now uses __extension__ for GCC 2.8 or later,
so go with that.
* lib/obstack.h (__extension__):
---
 ChangeLog     | 11 +++++++++++
 lib/obstack.h |  5 +----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 10d4f7a..0d0ac9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2014-03-27  Paul Eggert  <[email protected]>
 
+	obstack: Remove ancient NeXTSTEP gcc support conditional
+	This change will ease merging with glibc.  The "#if ... __NEXT__"
+	causes a warning with -Wundef which glibc now enables by default.
+	Problem reported by Will Newton in
+	<http://lists.gnu.org/archive/html/bug-gnulib/2014-03/msg00032.html>.
+	glibc <sys/cdefs.h> now uses __extension__ for GCC 2.8 or later,
+	so go with that.
+	* lib/obstack.h (__extension__):
+
+2014-03-27  Paul Eggert  <[email protected]>
+
 	obstack: merge with glibc changes
 	* lib/obstack.c, lib/obstack.h: Merge from glibc.
 	This is mostly indenting and commentary changes.
diff --git a/lib/obstack.h b/lib/obstack.h
index f847a53..f92492f 100644
--- a/lib/obstack.h
+++ b/lib/obstack.h
@@ -258,10 +258,7 @@ extern int obstack_exit_failure;
 #define obstack_memory_used(h) _obstack_memory_used (h)
 
 #if defined __GNUC__
-/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
-   does not implement __extension__.  But that compiler doesn't define
-   __GNUC_MINOR__.  */
-# if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
+# if ! (2 < __GNUC__ + (8 <= __GNUC_MINOR__))
 #  define __extension__
 # endif
 
-- 
1.9.0

Reply via email to