Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Feb 2018 08:12:36 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329447 - head/sys/compat/linuxkpi/common/include/asm
Message-ID:  <201802170812.w1H8CaJg066733@repo.freebsd.org>

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



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