bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] ignore-value: port to gcc -pedantic


From: Paul Eggert
Subject: [PATCH] ignore-value: port to gcc -pedantic
Date: Sun, 23 Jun 2013 11:55:33 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

* lib/ignore-value.h (ignore_value):
Port to gcc -pedantic, by using __extension__.
Reindent as per usual gnulib style nowadays.
Simplify GCC version check.
---
 ChangeLog          |  8 ++++++++
 lib/ignore-value.h | 13 +++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ce43380..5898ff0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-06-23  Paul Eggert  <address@hidden>
+
+       ignore-value: port to gcc -pedantic
+       * lib/ignore-value.h (ignore_value):
+       Port to gcc -pedantic, by using __extension__.
+       Reindent as per usual gnulib style nowadays.
+       Simplify GCC version check.
+
 2013-06-21  Paul Eggert  <address@hidden>
 
        extern-inline: port to gcc -std=c89
diff --git a/lib/ignore-value.h b/lib/ignore-value.h
index 63ecde8..ebd6bf4 100644
--- a/lib/ignore-value.h
+++ b/lib/ignore-value.h
@@ -33,15 +33,16 @@
    declared with attribute warn_unused_result".  */
 
 #ifndef _GL_IGNORE_VALUE_H
-# define _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 __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
-#  define ignore_value(x) ((void) (x))
-# else
-#  define ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; }))
-# endif
+#if 3 < __GNUC__ + (4 <= __GNUC_MINOR__)
+# define ignore_value(x) \
+    (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; }))
+#else
+# define ignore_value(x) ((void) (x))
+#endif
 
 #endif
-- 
1.7.11.7





reply via email to

[Prev in Thread] Current Thread [Next in Thread]