Re: git: 93d301d95ab2 - main - Remove -fms-extensions throughout the tree

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Fri, 24 Apr 2026 20:38:59 UTC
On Fri, 24 Apr 2026, Bjoern A. Zeeb wrote:

> The branch main has been updated by bz:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=93d301d95ab230ea159b21b5412aac2ce5362ac5
>
> commit 93d301d95ab230ea159b21b5412aac2ce5362ac5
> Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
> AuthorDate: 2026-02-03 01:51:40 +0000
> Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
> CommitDate: 2026-04-24 20:36:15 +0000
>
>    Remove -fms-extensions throughout the tree
>
>    During a discussion about using -fms-extensions jhb pointed out that
>    we have them enabled in the kernel for gcc by default (even multiple
>    times in one part). I had missed all that and clang still failed on
>    my use case (needing another option).
>
>    The original cause for enabling them for our tree back then was that
>    we needed to support C11 anonymous struct/unions.
>    Our in-tree gcc 4.2.1, despite later patches, needed the
>    -fms-extensions to support these even though this was not the expected
>    use case for that option ( cc4a90c445aa0 enabled it globally for the
>    kernel).
>    clang at that time (or at least when it became default for 10.0)
>    already was fine (with C11).
>
>    Any later gcc (4.6.0 onwards) did not need that option anymore, even
>    when compiled for -std=iso9899:1990 (which does not support anonymous
>    structs/unions) unless one would add -pedantic (see gcc git 4bdd0a60b27a).
>    This is also the reason why userland cddl sources now compile with the
>    option removed despite CSTD=c99.
>
>    The only driver which needed the option recently was ccp, but that was
>    fixed in 8d3f41dbcb2a by jhb.
>
>    So cleanup all uses cases of -fms-extensions for the moment as they are
>    no longer needed given all compilers currently supported seem to be
>    fine without them and gcc-4.2.1 was removed from the tree in stable/13
>    in 2020 (a9854bc3812b).

I should also say there was a lot of testing and exchaning emails with jhb
back and forther in order (for me) to understand when and why we needed this
(and when no longer).  Thanks a lot jhb!


>    Reported by:    jhb (all this but possibly the world CDDL parts)
>    Sponsored by:   The FreeBSD Foundation
>    MFC after:      3 days
>    Reviewed by:    emaste (earlier), imp, jhb, glebius
>    Differential Revision: https://reviews.freebsd.org/D55072

-- 
Bjoern A. Zeeb                                                     r15:7