|
|
|
|
|
by olliej
687 days ago
|
|
The problem is C lacks an equivalent to C++’s constexpr (or preceding template insanity), so you can’t use functions in constant contexts, eg struct S {
int foo[max(10, 15)];
}
Isn’t possible in C, macros are the only option.So even if you were to try to use _Generic in a macro to handle type correct dispatch you would not be able to use that macro in many of the contexts it is needed. Honestly constexpr is something that would really help C, and does not need to bring in any other c++ features. Although I guess in this case the lack of the full template and such features set would mean matching the kernel requirements would still require a macro+_Generic to adopt. |
|