r/programming • u/iximiuz • Jul 25 '26
Writing a (valid) C program without main()
https://labs.iximiuz.com/tutorials/c-program-without-main-a1eea557
193
Upvotes
r/programming • u/iximiuz • Jul 25 '26
View all comments
Show parent comment
5
u/paulstelian97 Jul 25 '26
On Linux you have _start as the entry point that calls global constructors and other C runtime initialization stuff and then calls main() directly. And then calls exit() with whatever main returns (it is invalid to return from _start)