From owner-freebsd-net@FreeBSD.ORG Sun Mar 1 22:00:25 2009 Return-Path: Delivered-To: net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E642A1065679 for ; Sun, 1 Mar 2009 22:00:25 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 8372B8FC08 for ; Sun, 1 Mar 2009 22:00:25 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 7AFCB1CCED; Sun, 1 Mar 2009 23:00:24 +0100 (CET) Date: Sun, 1 Mar 2009 23:00:24 +0100 From: Ed Schouten To: Julian Elischer Message-ID: <20090301220024.GU19161@hoeg.nl> References: <20090301161827.GR19161@hoeg.nl> <49AAFF4F.6010400@elischer.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BxNWZcw0TMazIwHZ" Content-Disposition: inline In-Reply-To: <49AAFF4F.6010400@elischer.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: net@FreeBSD.org Subject: Re: Making Netgraph compile with LLVM X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2009 22:00:26 -0000 --BxNWZcw0TMazIwHZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Julian Elischer wrote: > Ed Schouten wrote: >> Hello all, >> >> It turns out Netgraph uses a language construct that is only allowed >> with GCC, but not with LLVM. According to the specs, LLVM's behaviour is >> correct. It is not allowed to do this: >> >> struct a { >> struct { >> int i; >> char j[]; >> } b; >> char k[20]; >> }; >> >> error: variable sized type 'b' must be at end of struct or class > > not sure wher eyou are seeing this. > > the examples you fix don't seem to be nested structs.. what is the =20 > outer struct? In the Netgraph code, this isn't done in a single declaration, but there are several structs that (indirectly) nest pppoe_tags. An example is ng_pppoe.c, line 1179: struct { struct pppoe_tag hdr; union uniq data; } __packed uniqtag; It turns out that this is not valid: http://llvm.org/bugs/show_bug.cgi?id=3D3671 --=20 Ed Schouten WWW: http://80386.nl/ --BxNWZcw0TMazIwHZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmrBXgACgkQ52SDGA2eCwWvTwCfT9S4ZedrmC8o8/6UZCz1yClU DcUAn3o+LBuh1fZaW6ZYw6VlBb44+BA9 =MuBd -----END PGP SIGNATURE----- --BxNWZcw0TMazIwHZ--