Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wherever the code refers to a variable or function, the compiler only allows this if it has previously seen a declaration for that variable or function—the declaration is a promise that a definition exists somewhere else in the whole program.

The notable exception here is implicitly declared functions, but they were dropped in C99 anyway.



Indeed. After reading the OP and finally getting a handle on how linkers, assemblers, compilers, etc. work, I asked myself why functions weren't just implicit. Turns out K&R thought the same, but the solution sucked because it assumes an int return, which may not be what the function actually returns.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: