Comment Code section with #if's as per expression

General questions regarding the usage of CodeLite
hbr_in
CodeLite Expert
Posts: 113
Joined: Fri Jul 11, 2008 9:12 am
Contact:

Comment Code section with #if's as per expression

Post by hbr_in »

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)

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++;
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
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Comment Code section with #if's as per expression

Post by eranif »

There is an open bug for nested ifdef inside

Code: Select all

#if 0
section, I tried to fix this and it appears that to fix this is requires a massive change in Scintilla's (which I lack the knowledge) source code. I will remove this feature in the next build, since if I cant make it work properly, I prefer not to have it at all

Eran
Make sure you have read the HOW TO POST thread
Post Reply