(sorry if this is more a compiler question) I wonder what the compiler does with unused functions, does it neglect them while creating the executable? someone may say there's no point in defining functions that won't be used but (for example) writing a static library we have to do it and then any project linked against that library will usually use only "some" of the functions in there. I think non used functions are not included, because otherwise they will all add to the size of the executable... ?
(I get confused because also if they are included that means(to me) that the linker is "dissecting" the object files in the library to only find and use the functions the program needs. Although this sounds like the more efficient decision, is that what's happening?)
---
P.S.: And how about the same question about dynamic libraries? (thanks)