From: Bruno Haible Date: Sun, 9 Aug 2020 13:07:28 +0000 (+0200) Subject: ignore-value: Simplify on clang. X-Git-Tag: v1.0~3797 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=cae4fcab00ff89a5271376aed615cfa8c067fca2;p=gnulib.git ignore-value: Simplify on clang. * lib/ignore-value.h (ignore_value): With clang, no need to use the GCC workaround. --- diff --git a/ChangeLog b/ChangeLog index 77fb963613..92cdbf8574 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-08-09 Bruno Haible + + 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 Use __typeof__ with clang. diff --git a/lib/ignore-value.h b/lib/ignore-value.h index 7a92226843..ec3288f0df 100644 --- a/lib/ignore-value.h +++ b/lib/ignore-value.h @@ -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