From owner-svn-src-all@FreeBSD.ORG Fri Jan 30 19:40:35 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6173ED5F for ; Fri, 30 Jan 2015 19:40:35 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 39AE3D68 for ; Fri, 30 Jan 2015 19:40:35 +0000 (UTC) Received: from c0152.aw.cl.cam.ac.uk (c0152.aw.cl.cam.ac.uk [128.232.100.152]) by cyrus.watson.org (Postfix) with ESMTPSA id 2823046B2C; Fri, 30 Jan 2015 14:40:34 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: Re: svn commit: r277203 - in head/sys: kern sys From: "Robert N. M. Watson" In-Reply-To: <20150115123557.GC7669@britannica.bec.de> Date: Fri, 30 Jan 2015 19:40:33 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201501142344.t0ENi0tI088747@svn.freebsd.org> <20150115123557.GC7669@britannica.bec.de> To: Joerg Sonnenberger X-Mailer: Apple Mail (2.1993) Cc: svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2015 19:40:35 -0000 > On 15 Jan 2015, at 12:35, Joerg Sonnenberger = wrote: >=20 > On Wed, Jan 14, 2015 at 11:44:00PM +0000, Robert Watson wrote: >> - As we anticipate embedding mbufs headers within variable-size = regions of >> memory in the future, change the definitions of byte arrays = embedded in >> mbufs to be of size [0] rather than [MLEN] and [MHLEN]. >=20 > This is not valid C. You may be able to use flexible array members = ([]) > instead. Life is not that simple -- see the Phabricator review discussion which = considers this point in detail. The short version is: using [] for the = last entry in a union within a structure is explicitly disallowed in the = C spec, actually works fine with [0] in gcc + extensions, which are a = feature used in the kernel already. If in doubt, try replacing [0] with = [] and recompiling, it's an instructive and morally improving process. = We will want to feed this back to the C standardisation folk at some = point. Robert=