Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The pre-main runtime doesn't do much

This only applies to C++, but the CRT runs all constructors of global variables before main/WinMain. (Or rather, the CRT calls a special function that the compiler generates for this purpose and links into the executable.) In some codebases, that's quite a lot of stuff.



There is also initialization relevant for C code, e.g. strlen() will crash if you call it from the startup function directly without properly initializing msvcrt.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: