User forums > Using Code::Blocks
Questions on "Gray out Inactive Preprocessor Code"
Jenna:
--- Quote from: Calmarius on July 04, 2013, 02:56:37 pm ---Just upgraded CB to 12.11 at work. And this gray out preprocessor thing caught me off guard...
The project uses makefiles for compiling, and almost every preprocessor thing is defined in these makefiles.
Now every positive #ifdef and #if defined blocks are grayed out. I see no option to turn inactive thing off.
The only workaround so far is defining the inactive colors to be the same as the normal color.
--- End quote ---
Did you try to uncheck "Settings -> Editor -> General settings -> C/C++ Editor settings -> Colouring and highlighting options -> Interpret #if ..." ?
Joerg:
just to throw in my two cents:
I like the feature in general, but it is not working as it pretends.
The option 'collect defines from project file' gives the impression that #defines in other files would be parsed and evaluated.
But in my C file everything is greyed out, though #defines are placed in an include file, included directly by this file.
The project structure is really quite simple.
pmlonline:
I just tested this on Windows 10 and Lubuntu and it's not looking into include files. Does anyone know where the code is located? I'll take a quick look to see if it's an easy fix.
oBFusCATed:
lex_cpp.cpp probably. It is not an easy fix...
You have to implement the include searching logic of a compiler and also somehow pass the compile parameters to the editor.
pmlonline:
It looks like it scans through the file without scanning through the include files. If there's already existing code that scans through include files then maybe we could use that code. Doesthe Goto declaration and Goto implementation scan through include files?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version