Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340536

Summary: Handle multiple include file candidates more intelligently
Product: [Tools] CDT Reporter: Jonathan Watt <jwatt>
Component: cdt-indexerAssignee: Project Inbox <cdt-indexer-inbox>
Status: RESOLVED WONTFIX QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Jonathan Watt CLA 2011-03-20 22:23:50 EDT
Build Identifier: 

This is a problem when using Eclipse as an IDE for larger projects like Mozilla. In the case of Mozilla, headers from one module that need to be used by other modules are copied into a common include directory. Adding this directory to the include path in Eclipse unfortunately give Eclipse problems when analyzing the source files in a module's directory where those files use headers in that directory that have also been copied to the common project-wide Mozilla include directory.

It seems like Eclipse should just choose one of the matching header files - preferably the one in the same directory as the source file at hand.

Reproducible: Always
Comment 1 Markus Schorn CLA 2011-03-28 08:52:17 EDT
If the parser finds a header on the include search path it uses it (Any other behavior is not acceptable).
If the parser does not find the header on the search path, then it uses the one that is closeest to the file that includes the header. You may be able to solve the issue by removing the common include folder from the include search path.