It depends on the compiler. Visual C++ 9 can do that – unused static
functions are removed at compilation phase (there’s even a C4505 warning for that), unused functions with external linkage can be removed at link phase depending on linker settings.
More Related Contents:
- Where are static variables stored in C and C++?
- What’s the difference between __PRETTY_FUNCTION__, __FUNCTION__, __func__?
- What is special about numbers starting with zero?
- Best compiler warning level for C/C++ compilers? [closed]
- Can placement new for arrays be used in a portable way?
- What does it mean when a numeric constant in C/C++ is prefixed with a 0?
- Qt: can’t find -lGL error
- How to create a static library with g++?
- Why does C need “struct” keyword and not C++?
- Unexpected order of evaluation (compiler bug?) [duplicate]
- Atomic operations, std::atomic and ordering of writes
- Compile-time assertion?
- Why don’t the C or C++ standards explicitly define char as signed or unsigned?
- What do C and Assembler actually compile to? [closed]
- Understanding return value optimization and returning temporaries – C++
- Declaring and initializing a variable in a Conditional or Control statement in C++
- Portability of #warning preprocessor directive
- Update GCC on OSX
- Automatically adding Enter/Exit Function Logs to a Project
- Understanding stack frame of function call in C/C++? [closed]
- What issues can I expect compiling C code with a C++ compiler?
- “No newline at end of file” compiler warning
- C++ string literal data type storage
- Two classes that refer to each other
- Looking for 16-bit x86 compiler
- How are GCC and g++ bootstrapped?
- shared_ptr: horrible speed
- Fun with uninitialized variables and compiler (GCC)
- What Rules does compiler have to follow when dealing with volatile memory locations?
- Does an R compiler to C/C++ exist?