git: 3cfcbbfaf83a - main - cdefs.h __generic: avoid gcc -Wunused-value
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 02 Jul 2024 19:15:10 UTC
The branch main has been updated by rlibby:
URL: https://cgit.FreeBSD.org/src/commit/?id=3cfcbbfaf83aa0a61c1fd72cb1e82a011b08bc83
commit 3cfcbbfaf83aa0a61c1fd72cb1e82a011b08bc83
Author: Ryan Libby <rlibby@FreeBSD.org>
AuthorDate: 2024-07-02 19:12:59 +0000
Commit: Ryan Libby <rlibby@FreeBSD.org>
CommitDate: 2024-07-02 19:12:59 +0000
cdefs.h __generic: avoid gcc -Wunused-value
Fixup after
9d2f97981755 <sys/cdefs.h>: Decay expression passed to fallback version of __generic()
Reviewed by: imp, jrtc27, kib
Differential Revision: https://reviews.freebsd.org/D45825
---
sys/sys/cdefs.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index 53ac1b1c3f92..7c4890ece8d5 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -244,8 +244,8 @@
_Generic(expr, t: yes, default: no)
#elif !defined(__cplusplus)
#define __generic(expr, t, yes, no) \
- __builtin_choose_expr( \
- __builtin_types_compatible_p(__typeof((0, (expr))), t), yes, no)
+ __builtin_choose_expr(__builtin_types_compatible_p( \
+ __typeof(((void)0, (expr))), t), yes, no)
#endif
/*