Last month I reported on Linux 6.19 looking to enable Microsoft C Extensions support throughout the Linux kernel with setting the -fms-extensions compiler option to allow Microsoft C Extensions when building the kernel. Linus Torvalds today merged that support without objections.
The Microsoft C Extensions allow for some non-standard C/C++ constructs within the GCC and LLVM/Clang compilers. They are named the Microsoft C Extensions for being found in some Microsoft header files and being honored by the Microsoft Visual C/C++ compiler.
The main emphasis on enabling the Microsoft C Extensions is for permitting use of a tagged struct or union anonymously in another struct/union. This can allow for some “prettier code” while past efforts to enable -fms-extensions for the Linux kernel everywhere ended up falling through.
But now as of tonight in the mainline Linux 6.19 Git kernel state, the option has landed along with some early usage of it. The Btrfs file-system code adapted as an example comes down to:
More details for those interested via the Kbuild merge.
