Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2018 10:21:31 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r329956 - stable/11/sys/compat/linuxkpi/common/include/asm
Message-ID:  <201802251021.w1PALV5b009955@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 ||	\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802251021.w1PALV5b009955>