Author: hselasky
Date: Sun Feb 25 10:21:31 2018
New Revision: 329956
URL: https://svnweb.freebsd.org/changeset/base/329956

Log:
  MFC r329447:
  Compile in the LinuxKPI.
  
  Flexible array members are not allowed in a union.
  Use a zero length array instead.
  
  Reported by:  jbeich@
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h   Sun Feb 25 
10:19:44 2018        (r329955)
+++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h   Sun Feb 25 
10:21:31 2018        (r329956)
@@ -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-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to