Hacker News new | past | comments | ask | show | jobs | submit login

One file per C function is an old practice you can still see in many libc implementations and in other pieces of code designed to be used as a static library. Since a traditional Unix static library is nothing but an archive of .o files, and a traditional Unix linker makes its include-or-omit decisions on the granularity of an .o file, putting each function in a separate source file maximizes the linker's ability to strip unused functions out of a static library.



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

Search: