Author: hselasky Date: Sat Feb 17 08:12:35 2018 New Revision: 329447 URL: https://svnweb.freebsd.org/changeset/base/329447
Log: Compile fix for GCC in the LinuxKPI. Older versions of GCC don't allow flexible array members in a union. Use a zero length array instead. MFC after: 1 week Reported by: jbeich@ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Sat Feb 17 06:57:43 2018 (r329446) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Sat Feb 17 08:12:35 2018 (r329447) @@ -162,10 +162,10 @@ atomic_cmpxchg(atomic_t *v, int old, int new) #define cmpxchg(ptr, old, new) ({ \ union { \ __typeof(*(ptr)) val; \ - u8 u8[]; \ - u16 u16[]; \ - u32 u32[]; \ - u64 u64[]; \ + u8 u8[0]; \ + u16 u16[0]; \ + u32 u32[0]; \ + u64 u64[0]; \ } __ret = { .val = (old) }, __new = { .val = (new) }; \ \ CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \ _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"