Comment Code section with #if's as per expression
Posted: Thu Sep 04, 2008 7:41 am
Hi,
I was just going a huge c source code 2000 line code & found that many code section are not used( meaning they were inside #if with the macro name undefined)
In the above code, CL displays the print_debug lines normally. Since CL scans for all variables using cscope (REMOVE_UNUSED_CODE part) and it knows that REMOVE_UNUSED_CODE 1, shouldnt CL gray out or blur the code section that comes within the "#ifndef REMOVE_UNUSED_CODE" part.
Shouldnt CL gray/Blur out the code section that comes with #if 0 part
This is just a question that fled my mind
TIA
Regards
Gururaja
I was just going a huge c source code 2000 line code & found that many code section are not used( meaning they were inside #if with the macro name undefined)
Code: Select all
#define REMOVE_UNUSED_CODE 1
if(ErrorThrown) {
#ifndef REMOVE_UNUSED_CODE
print_debug("Shldnt reach this line\n");
#endif
return -1;
}
#if 0
print_debug("succ. so inc sucess count\n");
#endif
SuccessCount++;
Shouldnt CL gray/Blur out the code section that comes with #if 0 part
This is just a question that fled my mind
TIA
Regards
Gururaja