Because
main have to return an int.
See
ISO/IEC 9899 (C99) and
ISO/IEC 9899:201x (C11) at §
5.1.2.2.1 Program startup:
Quote:
The function called at program startup is named main. The implementation declares no
prototype for this function. It shall be defined with a return type of int and with no
parameters:
int main(void) { /* ... */ }
or with two parameters (referred to here as argc and argv, though any names may be
used, as they are local to the function in which they are declared):
int main(int argc, char *argv[]) { /* ... */ }
or equivalent, or in some other implementation-defined manner.
You can define main with the 2 parameters
int argc and
char *argv[], or nothing. But the returns, as per all current standards, cannot be
void.
Anyway some compilers allow the form
void main(void) { /* ... */ } as
private extension not standard compliant.