Linux 6.19 Goes Ahead And Enables Microsoft C Extensions Support
([Linux Kernel] 4 Hours Ago
-fms-extensions)
- Reference: 0001596722
- News link: https://www.phoronix.com/news/Linux-6.19-Enables-MS-Ext
- Source link:
Last month I reported on [1]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 [2]Kbuild merge .
[1] https://www.phoronix.com/news/Linux-6.19-Patch-Would-MS-Ext
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2ddcf4962c1834a14340a1f50afafc3276c015bd
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 [2]Kbuild merge .
[1] https://www.phoronix.com/news/Linux-6.19-Patch-Would-MS-Ext
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2ddcf4962c1834a14340a1f50afafc3276c015bd