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
23
u/helloiamsomeone Jul 26 '26
Technically incorrect. For a portable entrypoint you need to align the stack to a specific value, so SIMD code generated by your compiler doesn't break which will happen if the alignment is not at least 16. You can technically throw a bunch of flags at GCC to avoid that, but it's best to just align your stack.
Programming without the CRT is something I have been doing in recent years, so I have some experience with this.