Quote Originally Posted by aghast View Post
In an embedded system, there will be a runtime library function that does whatever initialization is required. However, there is unlikely to be any initialization beyond "set everything to zero". Embedded systems force the coder to set up all the "magically happens before main() is called" parts of the system themselves.
Unless it's a janky/non-standard compiler, there will be a C runtime that initializes variables with values before main() is called even on embedded systems. That's the case with the most popular C compilers for AVR and PIC microcontrollers and with other microcontroller C compilers like SDCC/Z88DK. It's usually just a memcpy() (or often an inlined equivalent) from the read-only program space to RAM. There's no good reason (in my mind) not to properly support initialized global variables—it won't save code space since the programmer would have to do it in main() anyway.