From: "Jan Beulich" Subject: open-coded offsetof() in xen/include/public/ring.h Date: Tue, 23 Feb 2010 14:07:30 +0000 Message-ID: <4B83EF320200007800030AF5@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Using gcc 4.5 we're seeing a build failure of the netfront driver due to its use of the __RING_SIZE() macro in the size specification of array members of struct netfront_info. Since the use of pointer types in integer constant expressions is an extension (albeit one - for the specific form used here - so far supported by all compilers Xen appears to be used with, and certainly all of the ones I was able to test), I wonder whether requiring offsetof() to be defined in order to use __RING_SIZE (or really a clone thereof usable in constant expressions, since in that case a type rather than a pointer ought to be passed in) would be acceptable. Jan