I have a c file that I can compile with no problem using GCC
like below:
gcc foo.c
however using the same file I am receiving error of having defined functions inside main using clang
:
clang foo.c
foo:230:1: error: function definition is not allowed here
{
^
foo.c:241:1: error: function definition is not allowed here
{
^
foo.c:253:1: error: function definition is not allowed here
these instances of errors are the definitions of a new function inside the main section of the code. I want to know why GCC doesn't get bothered with this yet clang does?