| ▲ | mjs01 9 hours ago | |
Some unmentioned incompatibilities I've encountered that makes a C header not directly usable in C++: - C `_Atomic(T)` and C++ `std::atomic<T>`. C++23 has C compatible header `stdatomic.h` that defines `_Atomic(T)`, but it's still problematic - C `_Noreturn/noreturn` and C++ `[[noreturn]]`. C23 `[[noreturn]]` makes them compatible - C inline and C++ inline are different. Good news is their `static inline` are the same - C has anonymous struct. C++ doesn't. Both have anonymous union though | ||