I'm trying to removed unused code from my program - I can't delete the code for now, I just want to disable it for a start.
Let's say that I have the following code:
if (cond){
doSomething()
}
and cond
is always false so doSomething
is never called.
I want to do something like:
#define REMOVE_UNUSED_CODE 0
if (cond && REMOVE_UNUSED_CODE){
doSomething()
}
Now this is obvious to us (and hopefully for the compiler) that this code is unused.
Will the compiler remove all this if
condition or it will leave it and never get in?
P.S.: I can't use #if 0
for this purpose