Must an exit status always be supplied through os.exit()? Calling os.exit() inside main() prevents me from using defer, producing this diagnostic:
Error: Unreachable defer statement due to diverging procedure call at the end of the current scope
This GitHub Discussion suggests the approach below:
Can Odin main procedures provide a return value? - GitHub Discussion (https://github.com/odin-lang/Odin/discussions/3097) To imitate C's int main(), say, introduce a separate proc such as run that returns a value. Your main can simply invoke it and respond to its returned error as appropriate - perhaps calling os.exit() with a failure status, or taking whichever action your application needs.
Can main() supply an exit status another way while allowing return, defer, and the remaining control-flow constructs to behave as usual.