svn commit: r276485 - in head/sys: conf dev/cxgbe modules/cxgbe/if_cxgbe

Dimitry Andric dim at FreeBSD.org
Wed Jan 21 10:29:18 UTC 2015


On 21 Jan 2015, at 09:10, Navdeep Parhar <np at FreeBSD.org> wrote:
> 
> On Wed, Jan 21, 2015 at 09:00:03AM +0100, Dimitry Andric wrote:
>> On 21 Jan 2015, at 06:53, Navdeep Parhar <np at FreeBSD.org> wrote:
>>> 
>>> On Tue, Jan 20, 2015 at 10:36:16PM -0500, Pedro Giffuni wrote:
...
>> Alternatively, just use the ${GCC_MS_EXTENSIONS} Makefile macro, which
>> I specifically introduced for this issue.
> 
> Ah, a rose with another name.  I'm happy to use this but it's not clear why
> there is a GCC in the macro's name when clang deals with -fms-extensions
> just as well.

It's because only gcc (in base) requires this flag to support anonymous
unions, whereas clang also supports them without the flag.  None of the
sources requiring this flag use actual Microsoft C extensions.


>  (It's not even clear why the longer ${GCC_MS_EXTENSIONS}
> should be preferred to -fms-extentions.  Isn't this like #define ONE 1 ?)

Using -fms-extensions with clang can lead to other trouble, since it is
stricter about conflicts with Microsoft-reserved type names.  Last time
I ran into this problem, several of our system headers tried to override
type names which are reserved by Microsoft, leading to compile errors.

Meanwhile, that issue may have been solved, but the crutches are still
there.  Instead of the macro, you could also use:

CFLAGS.gcc+= -fms-extensions

But note that this flag is probably superfluous with newer gcc's, so
using the macro is still a better solution, because the compiler version
can be checked in a central location, such as sys/conf/kern.mk.


> In any case I'm perfectly fine with any change that doesn't involve a commit
> from me to gcc.

Fixing this version of gcc is not really worth the trouble, indeed.

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20150121/e8816734/attachment.sig>


More information about the svn-src-head mailing list