News: 0180031480

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

The Linux Kernel Looks To 'Bite the Bullet' In Enabling Microsoft C Extensions (phoronix.com)

(Monday November 10, 2025 @10:30PM (BeauHD) from the better-looking-code dept.)


Linux kernel developers are [1]moving toward enabling Microsoft C Extensions (-fms-extensions) by default in Linux 6.19 , with Linus Torvalds signaling no objection. While some dislike relying on Microsoft-style behavior, the patches in kbuild-next suggest the project is ready to "bite the bullet" and adopt the extensions system-wide. Phoronix reports:

> Rasmus Villemoes argued with [2]Kbuild: enable -fms-extensions that would allow for "prettier code" and others have noted in the past the potential for saving stack space and all around being beneficial in being able to leverage the Microsoft C behavior: "Once in a while, it turns out that enabling -fms-extensions could allow some slightly prettier code. But every time it has come up, the code that had to be used instead has been deemed 'not too awful' and not worth introducing another compiler flag for. That's probably true for each individual case, but then it's somewhat of a chicken/egg situation. If we just 'bite the bullet' as Linus says and enable it once and for all, it is available whenever a use case turns up, and no individual case has to justify it..."

>

> The second patch is [3]kbuild: Add '-fms-extensions' to areas with dedicated CFLAGS to ensure -fms-extensions is passed for the CPU architectures that rely on their own CFLAGS being set rather than the main KBUILD_CFLAGS. Linus Torvalds chimed in on the prior [4]mailing list discussion and doesn't appear to be against enabling -fms-extensions beginning with the Linux 6.19 kernel.



[1] https://www.phoronix.com/news/Linux-6.19-Patch-Would-MS-Ext

[2] https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git/commit/?id=c4781dc3d1cf0e017e1f290607ddc56cfe187afc

[3] https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git/commit/?id=5ff8ad3909524ad55297a434f87c238224825bf4

[4] https://lore.kernel.org/all/CAHk-=wg6mxof1=egFUDTNEj3__tCWLTbKjYLzxipVCn6ndXr+g@mail.gmail.com/



Well, I suppose -fms-extensions is better than (Score:2)

by 93 Escort Wagon ( 326346 )

-embrace-extend-extinguish

Re: (Score:2)

by OrangeTide ( 124937 )

It's a GNU-flavored version of those MS extensions, originally they added a subset of what MS does in order to let gcc use data structures in MS's headers and have somewhat source compatible builds (I think this was roughly around the time Cygwin popped up, but I'm not sure).

A fair number of professional teams enabled those extensions for non-Windows code because they like some of the tricks available with the extensions and use it in their proprietary or open source code. It's a trend that has finally spre

Q. Why is this so clumsy?
A. The trick is to use Perl's strengths rather than its weaknesses.
-- Larry Wall in <8225@jpl-devvax.JPL.NASA.GOV>