The C11 standard lists two kinds of environments: freestanding environment, meaning an embedded system or operative system, and hosted enviroment, meaning a program running on top of an OS.
5.1.2.1 Freestanding environment
In a freestanding environment (in which C program execution may take
place without any benefit of an operating system), the name and type
of the function called at program startup are implementation-defined.
In other words, in freestanding environments, the function called at startup could be called anything, and have any form. Most common is void main (void)
.
From C11, the chapter regarding hosted environment:
5.1.2.2.1 Program startup
The function called at program startup is named main. The
implementation declares no prototype for this function.
The "implementation" means the compiler, so the compiler declares no such function. It is up to the user (programmer) to do so. This can be done in the form int main (void)
or int main(int argc, char *argv[])
or in any implementation-defined way specified by the compiler. In any case, the function is defined by the user.
C++ is a bit stricter and enforces any of the two forms, and allows no implementation-defined version of main. From C++03 3.6.1:
An implementation shall not predefine the main function. This function
shall not be overloaded. It shall have a return type of type int, but
otherwise its type is implementation-defined. All implementations
shall allow both of the following definitions of main:
int main() { /* ... */ }
and
int main(int argc, char* argv[]) { /* ... */ }
Regarding whether main can be called or not: I don't believe there is anything in the C standard preventing this, even though calling main makes no sense whatsoever. Since it has no prototype, the only way to call it would be recursively, which is just a plain stupid thing to do, but quite possible.
In C++, calling main() was explicitly banned from C++03 and later standards:
The function main shall not be used (3.2) within a program. The
linkage (3.5) of main is implementation-defined. A program that
declares main to be inline or static is ill-formed.