Date: Sun, 1 Mar 2009 23:00:24 +0100 From: Ed Schouten <ed@80386.nl> To: Julian Elischer <julian@elischer.org> Cc: net@FreeBSD.org Subject: Re: Making Netgraph compile with LLVM Message-ID: <20090301220024.GU19161@hoeg.nl> In-Reply-To: <49AAFF4F.6010400@elischer.org> References: <20090301161827.GR19161@hoeg.nl> <49AAFF4F.6010400@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
* Julian Elischer <julian@elischer.org> 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
> 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=3671
--
Ed Schouten <ed@80386.nl>
WWW: http://80386.nl/
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)
iEYEARECAAYFAkmrBXgACgkQ52SDGA2eCwWvTwCfT9S4ZedrmC8o8/6UZCz1yClU
DcUAn3o+LBuh1fZaW6ZYw6VlBb44+BA9
=MuBd
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090301220024.GU19161>
