I wrote a small program in C on Ubuntu having function definitions within the main function and compiled it using GCC. It compiled and ran without error. However, writing the same program in Codeblocks on Windows doesn't compile, and issues an error that says function-definition is not allowed here.
So, does GCC on Ubuntu allow function definitions within a function? Will it always run perfectly (given that it has compiled and there is no logical error in the program)?