]> Savannah Git Hosting - gnulib.git/commitdiff
ignore-value: Simplify on clang.
authorBruno Haible <bruno@clisp.org>
Sun, 9 Aug 2020 13:07:28 +0000 (15:07 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 9 Aug 2020 13:07:28 +0000 (15:07 +0200)
* lib/ignore-value.h (ignore_value): With clang, no need to use the GCC
workaround.

ChangeLog
lib/ignore-value.h

index 77fb9636138ca7f2dcb26ab6e2d636cd413b357d..92cdbf8574d09739dea2fce3793f7ff8ba2703a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-08-09  Bruno Haible  <bruno@clisp.org>
+
+       ignore-value: Simplify on clang.
+       * lib/ignore-value.h (ignore_value): With clang, no need to use the GCC
+       workaround.
+
 2020-08-09  Bruno Haible  <bruno@clisp.org>
 
        Use __typeof__ with clang.
index 7a922268431290e06593e1254806d0aae3324117..ec3288f0dfc0b804c5c987ff4db64a119577dfb0 100644 (file)
@@ -39,8 +39,9 @@
    versions 3.4 and newer have __attribute__ ((__warn_unused_result__))
    which may cause unwanted diagnostics in that case.  Use __typeof__
    and __extension__ to work around the problem, if the workaround is
-   known to be needed.  */
-#if 3 < __GNUC__ + (4 <= __GNUC_MINOR__)
+   known to be needed.
+   The workaround is not needed with clang.  */
+#if (3 < __GNUC__ + (4 <= __GNUC_MINOR__)) && !defined __clang__
 # define ignore_value(x) \
     (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; }))
 #else