Thread overview
Does D supply basic error codes?
Jan 29, 2012
NewName
Jan 29, 2012
mta`chrono
Jan 29, 2012
bearophile
Jan 30, 2012
Jesse Phillips
Jan 29, 2012
Jonathan M Davis
January 29, 2012
Hello all.
C has EXIT_FAILURE and EXIT_SUCCESS to be returned from main().
Does D have similar predefined values?
January 29, 2012
import core.stdc.stdlib;

int main()
{
	return EXIT_FAILURE; // EXIT_SUCCESS works here too.
}


Am 30.01.2012 00:21, schrieb NewName:
> Hello all.
> C has EXIT_FAILURE and EXIT_SUCCESS to be returned from main().
> Does D have similar predefined values?

January 29, 2012
On Sunday, January 29, 2012 23:21:16 NewName wrote:
> Hello all.
> C has EXIT_FAILURE and EXIT_SUCCESS to be returned from main().
> Does D have similar predefined values?

No, but you can use the C ones if you want, as mta`chrono points out.

- Jonathan M Davis
January 29, 2012
mta`chrono:

> import core.stdc.stdlib;
> 
> int main()
> {
> 	return EXIT_FAILURE; // EXIT_SUCCESS works here too.
> }

And in D void main(){} returns a EXIT_SUCCESS.

Bye,
bearophile
January 30, 2012
On Sunday, 29 January 2012 at 23:58:50 UTC, bearophile wrote:
> mta`chrono:
>
>> import core.stdc.stdlib;
>> 
>> int main()
>> {
>> 	return EXIT_FAILURE; // EXIT_SUCCESS works here too.
>> }
>
> And in D void main(){} returns a EXIT_SUCCESS.
>
> Bye,
> bearophile

Except when exited due to an exception thrown.