Community
Participate
Working Groups
There is a source code syntax check available that creates markers in the editor ruler for syntax errors (e.g. when a clamp is missing). This check seems to work only on active code. But such a low level check should also be available on inactive code.
This is not as simple as it sounds, because whether or not something is a syntax error can depend on declarations in previous inactive blocks. Consider: #ifdef FOO #define SOME_MACRO __attribute__((something)) #endif // later #ifdef FOO #define BAR #endif // yet later #ifdef BAR int SOME_MACRO x; #endif Here, to accurately determine that the line int SOME_MACRO x; is not a syntax error, CDT would have to parse the whole file in two contexts: once with 'FOO' defined, and once with 'FOO' not defined. In general, if there are 'n' macros that are used in conditional compilation of a file, CDT would need to parse the file 2^n times (more if the macros can have values other than just defined / not defined). This doesn't scale.
See also bug 389219, which proposes to index inactive code branches.