The same extension can be enabled with `-fplan9-extensions`, might be more appealing to some!
One of the link of past discussions was from Apr 2018 and discusses it. At that time GCC -fplan9-extensions support was too recent (gcc-4.6) to be considered. https://lore.kernel.org/lkml/20180419152817.GD25406@bombadil...
Now the reasoning isn't present in the patch but it probably is because they want step increments and -fms-extensions is a small-ish first step. Maybe -fplan9-extensions could make sense later, in a few years.
For this use case, at least, it feels like a CS version of racism. MSFT is bad, so no MSFT.
It largely clears up an idiosyncrasy from the evolution of C.
(but, as someone that briefly worked on plan9 in 1995/96, I like your idea :)
unwind•1h ago
The only concrete example is:
Accept some non-standard constructs used in Microsoft header files.
In C++ code, this allows member names in structures to be similar to previous types declarations.
[1]: https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#in...messe•1h ago
ISO C11 and onward allows for this:
In the above, you can access b as foo.b. In ISO C11, the inner struct/union must be defined without a tag. Meaning that this is invalid: As is this: union bar { int b; float c; }; -fms-extensions makes both of the above valid. You might be wondering why this is uesful. The most common use is for nicer struct embedding/pseudo-inheritance: [1]: https://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.htmlcreshal•1h ago
wahern•25m ago
> Some implementations have permitted anonymous member-structures and -unions in extended C to contain tags, which allows tricks such as the following.
> This proposal does not support that practice, for two reasons. First, it introduces a gratuitous difference between C and C++, since C++ implementations must treat the declaration of point within location as a forward reference to the type location::point rather than a definition of an unnamed member. Second, this feature does not seem to be used widely in applications, perhaps because it compiles differently in extended C vs. C++.See https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1406.pdf
arguflow•1h ago
[1]: https://lore.kernel.org/lkml/200706301813.58435.agruen@suse....