Hacker News new | ask | show | jobs
by agumonkey 2472 days ago
I love that you have to #include how to exit :)
2 comments

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.

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.)
And people think exiting vim is hard!

I suppose you could always quit abruptly, though...