Originally Posted by brewbuck
In case you're wondering... The reason you must not declare main(void) is because of parameter passing conventions. Under most ABI's, C parameters are evaluated and passed right-to-left, with the CALLER of the function being responsible for managing the stack. However it is conceivable that on some platform somewhere it is the CALLEE's responsibility to clean the stack.
The problem is, if the function is specifically declared to take a void argument list, the compiler (rightly) assumes that it will never be passed any arguments, so it will not produce the code necessary to fix the stack if arguments had been passed. Then, when the main(void) gets invoked, the C library DOES pass arguments (argc, argv), but main is not aware of this. So when main() returns, the stack becomes corrupt and things go wrong.