Code::Blocks Forums
User forums => General (but related to Code::Blocks) => Topic started by: linsys on May 04, 2015, 03:46:29 pm
-
Hello,
I've found a strange behavior in syntax highlight related to
WIN32, _WIN32, __WIN32, __WIN32__ symbols, it appear as if they
are always defined but only in syntax highlight.
I've attached a captured image to better explain
Best Regards
-
well after same more testing it come out that in:
Settings->editor->C/C++ Editor settings
options:
- Collect defines from project file
- Include host platform defines
changes this behavior, but not in the expected way:
it appear as if definitions from host and project have
precedence over definitions in local file
-
ok got it, the collector collect
all #define but not the #undef
like in the following example
#define T1
#undef T1
#if defined T1
#warning "defined"
#define TEST() printf("defined")
#else
#warning "not defined"
#define TEST() printf("not defined")
#endif
int main()
{
TEST();
return 0;
}
-
As you've already found this is a pretty basic feature by design and also it is implemented in our editor component which is provided by the Scintilla project.
The only thing we can do is implement our own semantic highlight, but no one has done it yet, unfortunately.
-
as you pointed also SciTE suffer of this bug, it appear that exist a two year old lexUndef.patch
I will investigate furter.
thank you