Hello,
I've always assumed that a C compiler (like gcc) compiles all functions, including those that you never call. Is it so?
I'm thinking of a situation where I have a .h file containing three independent functions: funcA(), funcB(), and funcC(). In the main program I call the functions funcA() and funcB() but never the function funcC().
Is the compiler smart enough to not compile the unused function, i.e. leave it out from the object file, or do I have to use #ifdef and #define to exclude the unused function?
Mon, 2017-01-16 17:57
#1
How smart C compiler is?