From cae4fcab00ff89a5271376aed615cfa8c067fca2 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 9 Aug 2020 15:07:28 +0200 Subject: [PATCH] ignore-value: Simplify on clang. * lib/ignore-value.h (ignore_value): With clang, no need to use the GCC workaround. --- ChangeLog | 6 ++++++ lib/ignore-value.h | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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 -- 2.39.5