Local function declaration seems to be permitted in gcc, and I found a discussion on this: Is there any use for local function declarations?
However, my question is: is
To fix the second example you need to declare f in main with proper return type
f
int main(void) { void f(void); // function declaration f(); // calling function } // scope of f ends here void f(void) {}
This way you inform compiler what to look for, and later it finds it indeed. Hope it helps.