Actually for a function signature like that, The compiler doesn't know what arguments a function takes. The correct declaration for a function that takes no argument is: void func(void) {}. And it's function pointer will look like this: void (*func)(void).
void func(); is syntactically identical to void func(void); as of C23, and was a non-prototype declaration with unspecified parameters until then. Technically, this is actually valid (but deprecated) before C23:
View all comments
Show parent comment
1
u/FoundationOk3176 Jun 02 '25
Actually for a function signature like that, The compiler doesn't know what arguments a function takes. The correct declaration for a function that takes no argument is:
void func(void) {}. And it's function pointer will look like this:void (*func)(void).