Skip to content

[Mono] Consider switching to C11 #90404

Closed
@lambdageek

Description

@lambdageek

Currently Mono is supposed to use C99. As a result, we're relying on platform or compiler intrinsics for some functionality that has been added to the standard since then such as stdatomic.h.

We should consider upgrading Mono to a more recent language standard.

This came up as part of #88279, for example.

Some concrete things we could take advantage of:

  • stdatomic.h for atomic reads/writes, CAS, etc
  • _Alignas
  • static assertions
  • _Noreturn
  • possibly thread locals (although the JIT likes to take advantage of understanding TLS layout, so we need to ensure we don't take a perf hit)

Some reasons we might not want to do it:

  • Anecdotally, I've heard that MSVC C11 support has some issues - we will need to understand the specific pitfalls to avoid so we don't break mono-aot-cross running on Win32 and also Mono on non-Windows Win32 platforms

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Build-monoenhancementProduct code improvement that does NOT require public API changes/additionsruntime-monospecific to the Mono runtime

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions