Stefan Reinauer (stefan.reinauer@coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10827
-gerrit
commit 34c7c8d402b9c192ff6bef20c2bf7a5cbec6d586 Author: Stefan Reinauer stefan.reinauer@coreboot.org Date: Tue Jul 7 21:31:55 2015 +0200
stddef.h: Disable check_member() macro when compiling with CLANG
CLANG assumes that _Static_assert() is a C++11 only feature and errs out when encountering the check_member macro complaining about a reinterpret_cast.
Change-Id: Id8c6b47b4f5716e6184aec9e0bc4b0e1c7aaf17c Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org --- src/include/stddef.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/src/include/stddef.h b/src/include/stddef.h index 3bbf914..f87c65f 100644 --- a/src/include/stddef.h +++ b/src/include/stddef.h @@ -32,9 +32,13 @@ typedef unsigned int wint_t;
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#if !defined(__clang__) #define check_member(structure, member, offset) _Static_assert( \ offsetof(struct structure, member) == offset, \ "`struct " #structure "` offset for `" #member "` is not " #offset ) +#else +#define check_member(structure, member, offset) +#endif
/** * container_of - cast a member of a structure out to the containing structure