diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/ignore-value.h | 5 |
2 files changed, 9 insertions, 2 deletions
@@ -1,5 +1,11 @@ 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. * m4/stdint.m4 (gl_STDINT_H): Check for SIZE_MAX also on "clang -std=gnu99". 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 |