Community
Participate
Working Groups
Hi, We have a C project that contains several folders (per architecture) with headers with the same name. For each architecture only one folder is added in the include path (it is done in our build infrastructure which not integrated to eclipse). For example: src/test.c: *********** #include <stdio.h> #include <stdlib.h> #include "api.h" int main(void) { MyEnum enumVar = MyEnum_VALUE1; puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ return EXIT_SUCCESS; } src/folder_a/api.h: ******************* #ifndef DEFINED_API_H_ #define DEFINED_API_H_ typedef enum { MyEnum_VALUE1 = 0, MyEnum_VALUE2 } MyEnum; #endif src/folder_a_2/api.h: ********************* #ifndef DEFINED_API_H_ #define DEFINED_API_H_ typedef enum { MyEnum_VALUE1 = 0, MyEnum_VALUE2 } MyEnum; #endif In this simple project, when F3 is used in include line (src/test.c) file, navigation always goes to "folder_a". Even if I exclude "folder_a" navigation always goes to "folder_a". If F3 is used on MyEnum_VALUE1 (instead of include line), it works as expected on this simple project. Eclipse indexer configuration: Index unused headers + index all header variants (according to my analysis, changing the configuration did not affect this issue). Expected behavior: As long as both directories are part of indexer, it should open both options and user should choose the appropriate one. If one of the directories are excluded from build, it should always choose the other one. The problem in a big project (real one) is worse: * Both folders ("a" and "a_2") are part of indexer: It always jumps to "a" folder and ignores the other one. * Folder "a" is excluded from build: F3 on include line jumps to "a" folder. F3 on the enum jumps correctly to "a_2". But call hierarchy / find reference on the enum does not work (this part works ok on simple project). This issue caused me a lots of trouble as eclipse jumped to a wrong header although project was configured correctly.
I can confirm that I see the same behaviour as you. I agree it should be improved. Do you know if this is a regression or a long-standing issue? (In reply to Yevgeny Shifrin from comment #0) > Even if I exclude "folder_a" I assume by that you mean Folder Properties -> C/C++ Build -> Exclude resource from build?