3 ms·
No, this isn't so. And besides, the main function isn't even the first thing in your program to run. The standard library does some setting up first. For instan
by im3w1l 6y ago
No, this isn't so. And besides, the main function isn't even the first thing in your program to run. The standard library does some setting up first. For instance populating argc and argv.
You may enjoy reading this: http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html http://www.muppetlabs.com/~breadbox/software/tiny/teensy.htm... It explains a lot of how linux loads programs. It's a bit dated though: everything is 32 bit.
- sszz 6y agoThere is definitely a main function in the CPython source code.
- nurettin 6y agoThe code to parse and populate commandline arguments comes from the linker, and is part of the generated binary, not the standard library. Here's a much better explanation https://embeddedartistry.com/blog/2019/04/08/a-general-overview-of-what-happens-before-main/ https://embeddedartistry.com/blog/2019/04/08/a-general-overv...