two mains

Tyro[17] nospam at home.com
Sun Jan 27 14:00:31 PST 2013


On 1/27/13 8:57 AM, David Nadlinger wrote:
> On Saturday, 26 January 2013 at 20:42:27 UTC, Tyro[17] wrote:
>> Trying to learn from the ground up and would appreciate some
>> assistance making sense of the following:
>>
>> // void main(){} [1]
>> [...]
>
> This might not be directly relevant here, but in general, I'd steer
> clear of main() for such experiments. Due to its special nature (several
> possible signatures, but the calling code in druntime stays the same),
> there is quite a bit of extra magic going on internally.
>
> For example, you wouldn't normally find "xor EAX, EAX" in a
> void-returning functions, as its purpose is to set the return value to
> 0, which implicitly happens to make the void main() and void
> main(string[]) variants conform to the "full" int main(string[]) signature.
>
> David

Thank you much. Things are starting to get a little clearer. Oh, thanks 
Vlad.


More information about the Digitalmars-d-learn mailing list