Name n3450 - Function pointers are more readable with typeof() Category Cosmetic readability improvements Author Alejandro Colomar Andres Cc Jakub Ɓukasiewicz Description Most functions are simple enough that the return type is strictly to the left of the function name. However, functions that return a function pointer type are different, which makes them less readable. signal(2) is a notable case of this, where a parameter also has a function pointer type, which makes it even less readable. With typeof(), recently added in C23, these declarations can be "normalized". This proposal only changes the prototypes of libc functions. Proposed wording 7.14.2.1p1 -void (*signal(int sig, void (*func)(int)))(int); +typeof(void (int)) *signal(int sig, typeof(void (int)) *func); 7.24.1p5 -void call_once(once_flag *flag, void (*func)(void)); +void call_once(once_flag *flag, typeof(void (void)) *func); 7.24.5.2p1 -int atexit(void (*func)(void)); +int atexit(typeof(void (void)) *func); 7.24.5.3p1 -int at_quick_exit(void (*func)(void)); +int at_quick_exit(typeof(void (void)) *func); 7.24.6.2p1 QVoid *bsearch(const void *key, QVoid *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *)); + typeof(int (const void *, const void *)) *compar); 7.24.6.3p1 void qsort(void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *)); + typeof(int (const void *, const void *)) *compar); 7.29.2.1p1 -void call_once(once_flag *flag, void (*func)(void)); +void call_once(once_flag *flag, typeof(void (void)) *func); K.3.6.4.2p1 QVoid *bsearch_s(const void *key, QVoid *base, rsize_t nmemb, rsize_t size, - int (*compar)(const void *k, const void *y, void *context), + typeof(int (const void *k, const void *y, void *context)) + *compar, void *context); K.3.6.4.3p1 errno_t qsort_s(void *base, rsize_t nmemb, rsize_t size, - int (*compar)(const void *x, const void *y, void *context), + typeof(int (const void *x, const void *y, void *context)) + *compar, void *context); B.13, B.23, B.27 Equivalent changes, as they repeat these prototypes.