| Summary: | c header files with #ifdef macros included by mutiple source files are indexed failed | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Tenggui Fu <tenggui_fu> |
| Component: | cdt-indexer | Assignee: | Project Inbox <cdt-indexer-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | Markus Schorn <mschorn.eclipse> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, malaperle |
| Version: | 8.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
*** This bug has been marked as a duplicate of bug 197989 *** |
Build Identifier: 20110319-2305 Suppose there are three files in a C++ project. a "#ifdef #else #endif" macro is contained in the header file "funny.h", which is used to preprocess two different structures. The two structures are referenced in two source files "funny1.c" and "funny2.c" respectively. The code of the three files are as follows. After the project is indexed, only one structure can be referenced correctly and the other one is reported "could not be resolved". I guess that the header files could be parsed only once and only one block between #ifdef and #else or between #else and #endif can be found by the CDT-indexer. 1st file: funny.h #ifdef TEST1 typedef struct _test1 { int a; int b; }test1; #else typedef struct _test2 { int c; int d; }test2; #endif 2nd file: funny1.c #define TEST1 #include "funny.h" int funny1(void) { test1 tst; tst.a = 0; tst.b = 0; return 0; } 3rd file: funny2.c #include "funny.h" int funny2(void) { test2 tst; tst.c = 0; tst.d = 0; return 0; } Reproducible: Always Steps to Reproduce: 1. Create a C++ project 2. Add the three files "funny.h", "funny1.c" and "funny2.c" to the project 3. Index the project