frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

The Linux Kernel Looks to "Bite the Bullet" in Enabling Microsoft C Extensions

https://www.phoronix.com/news/Linux-6.19-Patch-Would-MS-Ext
30•keyle•2h ago

Comments

unwind•1h ago
Huh. I thought the article was vague on what exactly these extensions permit, so I'd thought I'd look up the GNU documentation. Surprisingly, it [1] was rather vague too!

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.

    typedef int UOW;
    struct ABC {
      UOW UOW;
    };

[1]: https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#in...
messe•1h ago
The important one is "Unnamed Structure and Union Fields"[1], in particular unnamed structs and union fields without a tag.

ISO C11 and onward allows for this:

    struct {
      int a;
      union {
        int b;
        float c;
      };
      int d;
    } foo;
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:

    struct {
      int a;
      union bar {
        int b;
        float c;
      };
      int d;
    } foo;
As is this: union bar { int b; float c; };

    struct {
      int a;
      union bar;
      int d;
    } foo;
-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:

    struct parent {
      int i;
      void *p;
    };

    void parent_do_something(struct parent *p);

    struct child {
      struct parent;
      const char *s;
    };

    struct child *c;
    struct parent *p = (struct child *)c; // valid
    parent_do_something(p);
    c.i++; // valid
[1]: https://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.html
creshal•1h ago
Why is this still not standardized?
wahern•25m ago
The original proposal at https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1406.pdf explains why.

> Some implementations have permitted anonymous member-structures and -unions in extended C to contain tags, which allows tricks such as the following.

  struct point { float x, y, z; };
  struct location {
    char *name;
    struct point; // inheritance in extended C, but
                  // forward declaration in C++
  };
> 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
A really good example of it is in this lore thread here [1]. He explains it better than me so I'll just link it here

[1]: https://lore.kernel.org/lkml/200706301813.58435.agruen@suse....

fuhsnn•1h ago
> though some may feel the wrong way around Microsoft C behavior being permitted

The same extension can be enabled with `-fplan9-extensions`, might be more appealing to some!

tleb_•22m ago
-fplan9-extensions adds even more, it is not an alias: https://gcc.gnu.org/onlinedocs/gcc-15.2.0/gcc/Unnamed-Fields...

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.

Quarrel•15m ago
It certainly seems to me that using this would eliminate 75% or so of the objections to it.

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 :)

mrlonglong•1h ago
Microsoft "embrace, extend and takeover" comes to mind here. Caveat emptor.
pezgrande•28m ago
Isn't this a case of Evil Linux embracing M$ in order to extinguish it?

The Tesla Paradox: When Vision Becomes a Company's Core Product

https://capitalfolly.com/tesla-at-the-crossroads/
1•d_e_solomon•17s ago•1 comments

Autism-aware application design: Tips for software testers

https://www.ministryoftesting.com/articles/autism-aware-application-design-tips-for-software-testers
1•rosiesherry•1m ago•0 comments

Transform APIs into MCP Servers in Seconds

https://convertmcp.com/
1•walterwootz•5m ago•1 comments

Political Performance

https://rodgercuddington.substack.com/p/the-performative-politician
1•freespirt•7m ago•0 comments

Has China found a way to make your drugs cheaper? Scientists think so

https://www.business-standard.com/health/china-drug-production-breakthrough-affordable-medicine-1...
1•akyuu•7m ago•0 comments

Railroad Engineering (1912)

https://archive.org/details/railroadenginee00webbgoog
1•tmoertel•10m ago•0 comments

Why Debt Funding Is Ratcheting Up the Risks of the A.I. Boom

https://www.nytimes.com/2025/11/10/technology/ai-data-centers-debt-risks.html
1•fleahunter•15m ago•0 comments

Why Everyone Wants to Meet the ' Most Boring Man'

https://www.nytimes.com/2025/11/10/climate/fatih-birol-iea.html
4•fleahunter•17m ago•0 comments

Chattel Childhood and the way we treat children as property

https://aella.substack.com/p/chattel-childhood
1•decimalenough•23m ago•0 comments

Interactive Kafka Streams Architecture Simulation

https://kafkastreamsfieldguide.com/tools/interactive-architecture
1•rmoff•23m ago•0 comments

Learn Cutlass the Hard Way

http://www.kapilsharma.dev/posts/learn-cutlass-the-hard-way/
1•mariuz•23m ago•0 comments

Show HN: Run HF Transformers in pure Go (10 MB binary, no Python)

https://github.com/openfluke/loom
1•openfluke•29m ago•0 comments

Tinder's AI plans to find matches by going through your photo gallery

https://www.theverge.com/news/815286/tinder-ai-chemistry-camera-roll-feature-test
1•velvet_thunderr•32m ago•1 comments

Show HN: Free CS Education for Future SWEs (YC F25)

https://www.vectorschool.ai/
2•sam_goldman•32m ago•0 comments

Latent Topic Synthesis: Leveraging LLMs for Electoral Ad Analysis

https://arxiv.org/abs/2510.15125
1•PaulHoule•36m ago•0 comments

Word, Character prediction in any language in the browser (ppmpredictor)

https://willwade.github.io/ppmpredictor/
1•willwade•38m ago•1 comments

Discovering the discovery of designated resolvers (DNS DDR)

https://labs.ripe.net/author/yevheniya-nosyk/discovering-the-discovery-of-designated-resolvers/
1•fanf2•38m ago•0 comments

The Gnome Village

https://happihacking.com/blog/posts/2025/the-gnome-village/
1•eproxus•39m ago•0 comments

Shake Build System

https://shakebuild.com
2•xlii•42m ago•2 comments

A hacking kingpin reveals all: Inside the gang that left a trail of destruction

https://www.bbc.com/news/articles/cm2w0pvg4wko
3•Lyngbakr•43m ago•0 comments

Git considers SHA-256, Rust, LLMs, and more

https://lwn.net/Articles/1042172/
5•john01dav•44m ago•1 comments

Using symlinks to manage multiple Git repos in a single Obsidian vault

https://www.ssp.sh/brain/add-external-folders-git-blog-book-to-my-obsidian-vault-via-symlink/
1•articsputnik•44m ago•0 comments

Australia's Solar Boom Is Breaking the Grid – Or Is It? [video]

https://www.youtube.com/watch?v=qavFbOpt4jA
3•defrost•47m ago•2 comments

Digel. Troubleshooting Agents for Manufacturing

https://www.digel.io/en
3•thoander•52m ago•1 comments

PHP MapReduce

https://github.com/spiritinlife/php-mapreduce
1•lun4r•53m ago•0 comments

Deep Learning for Molecules and Materials

https://dmol.pub/index.html
1•barrenko•1h ago•0 comments

I automated our first-round hiring process with AI (30 days → 3 days)

https://easyhireapp.com
1•PEGHIN•1h ago•2 comments

Tech billionaires back startup on gene-edited 'designer babies' despite US ban

https://nypost.com/2025/11/08/business/tech-billionaires-back-startup-pushing-illegal-gene-edited...
3•thisislife2•1h ago•0 comments

Checkly Adds DNS Monitors

https://feedback.checklyhq.com/changelog/now-resolving-dns-monitoring-zap
2•tnolet•1h ago•0 comments

The Unreasonable Effectiveness of AI Hallucinations – Brain Hurricane Blog

https://app.brainhurricane.ai/blog/harnessing-ai-hallucinations-for-creativity
1•L1nefeed•1h ago•1 comments