this post was submitted on 09 Nov 2025
77 points (96.4% liked)

Linux

10083 readers
640 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS
 

Two patches queued into the Linux kernel's build system development tree, kbuild-next, would enable the -fms-extensions compiler argument everywhere for allowing GCC and LLVM/Clang to use the Microsoft C Extensions when compiling the Linux kernel. Being in kbuild-next these patches will likely be submitted for the Linux 6.19 kernel merge window next month but remains to be seen if there will be any last minute objections to this change.

The -fms-extensions compiler option honored by the GNU Compiler Collection and LLVM/Clang allow enabling some non-standard C/C++ constructs used within Microsoft header files and honored by the the Microsoft Visual C/C++ compiler. For Linux kernel development purposes, enabling the Microsoft C Extensions would allow including a tagged struct or union anonymously in another struct/union.

you are viewing a single comment's thread
view the rest of the comments
[–] GreenCrunch@piefed.blahaj.zone 80 points 3 days ago* (last edited 3 days ago) (4 children)

From what I can see, the GNU Compiler Collection supports this flag, so you can still build it with 100% free software.

Basically, it's just behavior that doesn't align with the C standard, but was introduced by MS. Then, GCC added a compiler flag which makes it behave like that, so that you can build code that requires that behavior.

It doesn't seem to actually be dependent on MS, rather it's named after them because it emulates the way their compiler works. I hope no Linux maintainers would entertain the idea of making it dependent on a non-free compiler.

[–] clif@lemmy.world 23 points 2 days ago

behavior that doesn’t align with the C standard ... but was introduced by MS

Yep, that tracks. I'm still pissed off about microsoft's non-standard implementation of HTTP 1.1 from however long ago it was that I had to conditionally work around it on the server side. They believe standards don't apply to them and it seems like they're right.

[–] Truscape@lemmy.blahaj.zone 23 points 3 days ago

Ah, that makes sense. Thanks for the explanation! :)

[–] just_another_person@lemmy.world 18 points 3 days ago

The correct answer. It's just using an extension Microsoft happens to have made, and everything still works fine without it.

[–] Valmond@lemmy.world 2 points 2 days ago

int $ = 3;

Compiled with msvc back in the day for example, could be stuff like that. But IDK.