Hacker News new | ask | show | jobs
by huhtenberg 2641 days ago
Technically, you should be able to just call exit(1) because of the C's support for "implicit function declarations".

With no prior exit() declaration, the C compiler would assume that "exit" is "int exit()", spit out the code to push whatever arguments are passed to it down the stack and then just call the damn thing. So, magically, it will all just work. Requires an older compiler though, C89 the latest.

1 comments

Modern GCC and Clang still support implicit functions. They just complain about it by default. (Mostly for reasons that shouldn't be entirely relevant to modern x86.)