Playing around with #C23 stuff and got surprised by this not working…
void func(void);
typedef typeof(func) func_type;
Since a function name is neither an expression nor a type name, it's not supported as operand to typeof (not sure that's all), fair enough but why? @AaronBallman @thephd
I'd have used it to have the prototypes of a library functions in a header and use the typedef within the "private" .c only. This would avoid the alternative of duplicating the prototype within the typedef.
=> More informations about this toot | View the thread | More toots from stefanct@chaos.social
=> View AaronBallman@vivaldi.net profile | View thephd@pony.social profile
=> View c23 tag This content has been proxied by September (ba2dc).Proxy Information
text/gemini