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

Bug 317406

Summary: false choice presented when following declaration by F3
Product: [Tools] CDT Reporter: joex26 <mjoachimiak>
Component: cdt-indexerAssignee: Project Inbox <cdt-indexer-inbox>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3    
Version: 7.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description joex26 CLA 2010-06-21 04:57:32 EDT
Build Identifier: 20090920-1017

I have a project with own include tree:
include\versionA\foo.h, include\versionB\foo.h and two versions of foo.h files. In these files struct foobar {} is defined. In my executable I use versionA but in library I use versionB. This is imported makefile project. When I browse code in executable, by pressing F3 I jump to foobar definition in versionB headers which is wrong. The headers are specified correctly in per-target CFLAGS with -I options so there is no problem during compilation but only during code browsing.

Reproducible: Always

Steps to Reproduce:
1.Create automake/autoconf project
2.Create header files with the same names under inlcude dir ./include/A/foo.h , ./include/B/foo.h with same named structs defined.
3.add only one header dir to the search path when compiling the executable.
4.Import makefile based project to eclipse together with ./include/*
5.Eclipse code browser is confused and can drop you to the wrong header when you go to declaration/definition
Comment 1 joex26 CLA 2010-06-21 06:13:02 EDT
This behaviour was caused by using #define FOO_H at the beginning of header file.
Versions A and B were using same symbol FOO_H to check if the header file was already included. After changing the names of these symbols defined at the beginning of the header files to different, the code browse (search for definitions) works well.