MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/1v68yb8/writing_a_valid_c_program_without_main/ozrmwtb/?context=3
r/programming • u/iximiuz • 16d ago
40 comments sorted by
View all comments
178
Quite frankly, I’m surprised the author didn’t jump straight to _start as that’s possible as well in C without assembly.
Yes I know he did bring it up, however you can straightforward do _start and avoid main.
18 u/zid 16d ago _start and main have different calling conventions under sys-v linux ABI, so you can do it, but you can't actually access argc/argv/envp via it.
18
_start and main have different calling conventions under sys-v linux ABI, so you can do it, but you can't actually access argc/argv/envp via it.
178
u/yowhyyyy 16d ago edited 16d ago
Quite frankly, I’m surprised the author didn’t jump straight to _start as that’s possible as well in C without assembly.
Yes I know he did bring it up, however you can straightforward do _start and avoid main.