Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Indexer confusion(CDT indexer seems to scan unrelated directory for enum values)
Indexer confusion [message #1407879] Wed, 13 August 2014 17:44
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
I have a CDT project with several parallel source directories.

It seems that the CDT indexer gets confused with enumeration values
in headers in parallel directories. A minimal example contains two
directories, d/ and s/. There is a C source file d/d.c and a
corresponding header file d/d.h. In directory s/, there is a header
file s.h. Both header files contain an enumeration defining the same
value symbol.

So the structure is:

d/
d/d.c:
---
#include "d.h"

int testfunc(void)
{
return VALUE; /* this line will be flagged */
}
---

d/d.h:
---
#define BAD 0

#if BAD

enum separate
{
VALUE
};

#else

enum same
{
VALUE
};

#endif
---

s/
s/s.h:
---
enum same
{
ZERO,
VALUE
};
---

If #define BAD is changed to a non-zero value, CDT reports an error:

Symbol 'VALUE' could not be resolved d.c /test/d line 5 Semantic Error

The error disappears if the header file s.h is removed. As far as I
understand, the contents of directory s/ should not have any effect
to a file in directory d/, as s/ was not defined in the project include
search paths for the directory d/ and its ancestors.



--

Tauno Voipio
Previous Topic:Re-Generating makefile every build selected file
Next Topic:Remove Unwanted Include Directories
Goto Forum:
  


Current Time: Fri Apr 26 17:50:44 GMT 2024

Powered by FUDForum. Page generated in 0.02699 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top