It's non-standard. The standard prototype of main
is int main()
with the optional command line arguments argc
and argv
.
The int
returned by main()
is a way for a program to return a value to the system that invokes it. In Linux, the process always exits with a status value that the kernel collects. On systems that doesn't provide such a facility the return value is ignored, but that doesn't make void main()
legal. Even if your compiler accepts void main()
avoid it in any case. It's incorrect.
It's also worth noting that in C++, int main()
can be left without an explicit return statement at which point it defaults to returning 0. This is also true with a C99 program.