In the following program, I try to call the function
In function `n':
(.text+0xa): undefined reference to `m'
error: ld returned 1 exit status
m is defined inside of
main. In standard C, that's not allowed (you can't define a function within another function).
Some compilers (e.g. gcc) allow it as an extension. But then the function is local, i.e.
m only exists within
main and can't be seen from the outside. Similarly, variables defined within a function are local to that function and can't be seen from the outside.
void m(); declaration at the top claims that a (global) function called
m exists, but it doesn't. That's why you get the linker error.