Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Mar 2009 17:18:27 +0100
From:      Ed Schouten <ed@80386.nl>
To:        net@FreeBSD.org
Subject:   Making Netgraph compile with LLVM
Message-ID:  <20090301161827.GR19161@hoeg.nl>

next in thread | raw e-mail | index | archive | help

--rfCqmLcWnxF2yz6F
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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

Diane Bruce and I thought this patch should solve this issue:

	http://80386.nl/pub/ng.diff

Yes, I know, the solution isn't really elegant, but I think this is the
only way to do this safely. Diane and I also compared the output of
objdump and they seem to be equivalent, except for some reordering.

Objections before I commit this to SVN?

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--rfCqmLcWnxF2yz6F
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEUEARECAAYFAkmqtVMACgkQ52SDGA2eCwUXrgCeKX/bFUEP/k9paOHIgvxZzAzf
7PUAmKI4TJo4XEvffV3oqoIDbpQIl5E=
=Tp28
-----END PGP SIGNATURE-----

--rfCqmLcWnxF2yz6F--



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