View mode: basic / threaded / horizontal-split · Log in · Help
January 29, 2012
Does D supply basic error codes?
Hello all.
C has EXIT_FAILURE and EXIT_SUCCESS to be returned from main().
Does D have similar predefined values?
January 29, 2012
Re: Does D supply basic error codes?
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
Re: Does D supply basic error codes?
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
Re: Does D supply basic error codes?
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
Re: Does D supply basic error codes?
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.
Top | Discussion index | About this forum | D home