General practices

Steven Abner
Mon Sep 16 16:14:00 GMT 2019

Need some help:
I've gone through several of libgloss crt0 files, normally create code 
on the mac, love the editor!
Seen that Newlib has switched to 'FreeBSD' style FILE unit.
With the basic intro out of the way... the question is: from _start to 
main(), the normal 'return' from
main() dumps you back to _start from which I assume Newlib has a 
standard expected termination
of the process. Correct assumption? And is this expectation that of 
calling the 'exit' function?
The reason for this question is that the APPLE FreeBSD style does call 
'exit' which allows for clean
up, such as flushing files, calling atexit(), etc. and lunix does not 
allow for such a clean up using
'return' from main(). Maybe I just misunderstand the 'C' process?
Thanks in advance, and hopefully down the road I can offer up a 
smaller, embedded type FILE unit,
if I can work out the return vs. exit clean up. Not sure people want to 
stop using return for exit just
to flush stdout.

More information about the Newlib mailing list