Bump mono to -std=gnu11 (#91421)
Change the mono build to require C11 (with gnu extensions on gcc/clang platforms). * Change `g_static_assert` to be `_Static_assert` or `static_assert` as apropriate. * Change `_DN_STATIC_ASSERT` to be `static_assert` * Add static asserts in `jiterp.c` when it casts between `T*` and `atomic_T*` * Add C11 guidance to the mono coding guide doc Contributes to #90404 --- * Bump mono to -std=gnu99; use static_assert * don't fall back to runtime checks for g_static_assert * fix static assert that wasn't a constant expression * use static_assert in shared containers * bump C standard in offsets-tool.py * use _Static_assert before C23 Dont' include assert.h in glib.h because some of our older 3P code includes assert.h on its own and there are conflicts * use CMAKE_C_STANDARD and related properties * jiterp: static_assert that atomic ops are (less likely) to go wrong Not every C implementation guarantees that atomic operations on arbitrary types are lock free. So for example, casting between atomic_ushort* and uint16_t* might not actually be ok to do. We can't assert that they're inter-castable, but at least assert that they're the same size and that atomic_ushort is always lock-free. There might still be restrictions (for example atomic_ushort might have to be aligned differently) but this should at least catch obvious data corruption. * Add C11 guidance to the Mono coding guide * jiterp: long is 32-bits on wasm; use llong
Showing
想要评论请 注册 或 登录