3 ms·
With "typeof" standardized in C23 it kinda does the job: int(* fnptr_name)(int param) becomes typeof(int(int param))* fnptr_name There is a recent proposal to
by fuhsnn 2y ago
With "typeof" standardized in C23 it kinda does the job:
int(* fnptr_name)(int param) becomes typeof(int(int param))* fnptr_name
There is a recent proposal to update standard headers to this style:
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3450.txt https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3450.txt
- debugnik 2y ago-void (*signal(int sig, void (*func)(int)))(int); +typeof(void (int)) *signal(int sig, typeof(void (int)) *func); Much better honestly. The original took me a few reads to understand, until I noticed the outer (int) is part of the return type.