On Sat, 10 Jun 2023, Jakub Jelinek via Gcc-patches wrote: > I have looked at gnulib stdckdint.h and they are full of workarounds > for various compilers, EDG doesn't do this, clang <= 14 can't multiply > __int128, ..., so I think the header belongs into the compiler rather > than C library, because it would be a nightmare to maintain it there.
While C2x only has type-generic macros in this header, there's a proposal N2868 (which didn't get consensus for C2x but may come back for a future standard version) for additional interfaces for structure types with a sticky overflow flag, including some functions that are expected to be defined with external linkage as usual for library functions. So if that gets adopted in future, we'd need to arrange to provide those library functions with external linkage - which is mostly not something we do in GCC, although there are a few atomic_* functions in libatomic in addition to the __atomic_* functions underlying type-generic macros. > What I'm struggling with is enforcing the weird restrictions > C23 imposes on these. It's not clear all those restrictions need to be enforced - this definitely seems like a case of undefined behavior to provide useful extension space, where for various of those restrictions there are unique sensible semantics to provide if the types in question are supported. -- Joseph S. Myers jos...@codesourcery.com