Get the latest tech news
Parameterized types in C using the new tag compatibility rule
.com/blog/2025/06/26/ C23 has a new rule for struct, union, and enum compatibility finally appearing in compilers starting with GCC 15, released this past April, and Clang later this year. The same struct defined in different translation units (TU) has always been compatible — essential to how they work.
C23 has a new rule for struct, union, and enum compatibility finally appearing in compilers starting with GCC 15, released this past April, and Clang later this year. Due to Slice##T in the macro, required to establish a unique tag for each element type. I’ve written a small demo of the technique if you’d like to see it in action, or test the abilities of your local C implementation: demo.c
Or read this on Hacker News