On 4/2/14, Dicebot <pub...@dicebot.lv> wrote: > D main != C main, latter is implemented in D runtime to call the > former. 0 will be also returned by latter, not the former.
Actually, the compiler injects a return statement in D's main. It generates the actual C main function (unless WinMain/DllMain is provided), which calls another special D runtime init function, which itself calls the D main function (which itself has the injected return statement unless it's already an int return). It's quite complicated, but it's all open-source so you can inspect it.