changeset 37239:3bc441308c14

ignore-value: prefer GCC version back through 2.0 The code didn't match the comments, so I did a bit of software archaeology. GCC 2.0 seems to support __extension__ and __typeof__, so fix both code and comments to use 2.0. * lib/ignore-value.h (ignore_value): Use __extension__ and __typeof__ for GCC 2.0 through 3.3, too.
author Paul Eggert <eggert@cs.ucla.edu>
date Wed, 27 Nov 2013 14:52:17 -0800
parents e7bdef0ff2f9
children 8c0f23afb519
files ChangeLog lib/ignore-value.h
diffstat 2 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Nov 27 16:20:43 2013 +0100
+++ b/ChangeLog	Wed Nov 27 14:52:17 2013 -0800
@@ -1,3 +1,12 @@
+2013-11-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+	ignore-value: prefer GCC version back through 2.0
+	The code didn't match the comments, so I did a bit of software
+	archaeology.  GCC 2.0 seems to support __extension__ and
+	__typeof__, so fix both code and comments to use 2.0.
+	* lib/ignore-value.h (ignore_value): Use __extension__ and
+	__typeof__ for GCC 2.0 through 3.3, too.
+
 2013-11-25  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	pty: Activate the signature wrapper of forkpty.
--- a/lib/ignore-value.h	Wed Nov 27 16:20:43 2013 +0100
+++ b/lib/ignore-value.h	Wed Nov 27 14:52:17 2013 -0800
@@ -35,10 +35,10 @@
 #ifndef _GL_IGNORE_VALUE_H
 #define _GL_IGNORE_VALUE_H
 
-/* The __attribute__((__warn_unused_result__)) feature
-   is available in gcc versions 3.4 and newer,
-   while the typeof feature has been available since 2.7 at least.  */
-#if 3 < __GNUC__ + (4 <= __GNUC_MINOR__)
+/* The __attribute__((__warn_unused_result__)) feature is available in
+   gcc versions 3.4 and newer, while __typeof__ and __extension__ have
+   been available since 2.0 at least.  */
+#if 2 <= __GNUC__
 # define ignore_value(x) \
     (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; }))
 #else