On 2/4/2015 3:08 AM, Johannes Pfau wrote:
The compiler will still have to
generate a complete function which takes up space in the object
file.

Space in the object file is not important, space in the executable is. It's the linker's job to remove unreferenced functions (dmd places each function in its own section for that and other reasons). If the linker falls down on that job, an alternative is to use dmd to generate a library, where it will generate one object in the library per function. Then, the linker will only pull objects out of the library that are actually referenced.

Reply via email to