Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Mar 2017 19:47:13 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        Gleb Smirnoff <glebius@freebsd.org>, src-committers@freebsd.org,  svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r314862 - head/sys/modules/qlxgbe
Message-ID:  <20170308193709.Q2738@besplex.bde.org>
In-Reply-To: <70fcdcf4-cfa5-2382-ea60-55ac1a91e06b@FreeBSD.org>
References:  <201703071543.v27FhnoL024242@repo.freebsd.org> <20170307221733.GN1044@FreeBSD.org> <70fcdcf4-cfa5-2382-ea60-55ac1a91e06b@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 8 Mar 2017, Andriy Gapon wrote:

> On 08/03/2017 00:17, Gleb Smirnoff wrote:
>> On Tue, Mar 07, 2017 at 03:43:49PM +0000, Andriy Gapon wrote:
>> A> Author: avg
>> A> Date: Tue Mar  7 15:43:49 2017
>> A> New Revision: 314862
>> A> URL: https://svnweb.freebsd.org/changeset/base/314862
>> A>
>> A> Log:
>> A>   qlxgbe: add GCC_MS_EXTENSIONS to CFLAGS to make old base GCC happy
>> A>
>> A>   The module uses unnamed structure and union fields and base GCC in
>> A>   stable/10 doesn't like it.
>> A>   I think that that is a C11 feature, so it is courteous of more modern
>> A>   compilers to not complain about it when compiling in C99 mode.
>>
>> There are a lot of code in kernel, that uses anonymous structs and unions.
>> This feature is enabled globally. Why does this module need special treatment?

There is not a lot of such code.  There are a lot of ugly macros like
'define v_rdev v_un.vu_cdev' to avoid having such code since it is
unportable.

> That's a good question and I don't have a good answer to it.
> All I can say is that a GCC build of GENERIC and modules failed in that fashion
> only for this module (in stable/10).
> Maybe I described the problem incorrectly.  Then, a proper explanation is welcome.

I think gcc always had anonymous struct/unions, but GCC_MS_EXTENSIONS gives
a MSS variant of them which is even more unportable (but may actually be
better).

Bruce



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