Who receives the value returned by main()?
On a microcontroller, main() is not really expected to ever exit, and the behavior if it does is not defined &mdash; so it's up to whoever wrote the C runtime for the microcontroller. I've seen systems that:


Have an implicit loop around main(), so that if it exits, it simply gets called again.
Have a simple "jump-to-self" loop (or a HALT instruction) that gets executed if main() ever exits.
Simply execute the rest of code memory that follows the call to main(). This is called "running off into the weeds".


I've never seen one that actually does anything at all with the value returned by main(). If this is something you actually care about, then you should take a look at &mdash; and possibly modify &mdash; the source code for your system's C runtime library.