On Wednesday, 21 February 2024 at 12:45:50 UTC, Bastiaan Veelo wrote:
What do you mean by "need"? You can call https://dlang.org/phobos/core_stdc_stdlib.html#.exit from D:

Of course, but does it respect D shutdown?

Output:
```
onlineapp._sharedStaticDtor_L11_C1
```

So it does run module destructors, but not `scope(exit)` statements (which probably makes sense).

So it doesn't respect D shutdown, i.e. what happens when returning from main with an error code.

I would expect `exit()` called from the C source to have similar results.

Why is that?

I just found this.
[Proper way to exit with specific exit code?](https://forum.dlang.org/thread/bavfkowjjcijeshrt...@forum.dlang.org)





Reply via email to