Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358815 - No support for include directives, not between declarations on global scope.
Summary: No support for include directives, not between declarations on global scope.
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
: 445183 (view as bug list)
Depends on: 315964
Blocks:
  Show dependency tree
 
Reported: 2011-09-25 06:14 EDT by Bart Janusz CLA
Modified: 2020-09-04 15:18 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bart Janusz CLA 2011-09-25 06:14:31 EDT
Build Identifier: 201106081058

Parser is unable to correctly process and index following statements:

static int i =
#include "one.txt"
;

where one.txt contains one char ('1' char)

Syntax error is incorrectly reported, probably include isn't substituted before feeding source to parser leading to syntax error.

Reproducible: Always
Comment 1 Markus Schorn CLA 2011-09-26 05:23:36 EDT
Generalization of bug 315964
Comment 2 Nicklas Hansson CLA 2014-10-22 17:15:51 EDT
Will this ever be supported? If so, is there some kind of estimate as to when?
Comment 3 Nathan Ridge CLA 2014-10-22 17:24:18 EDT
(In reply to Nicklas Hansson from comment #2)
> Will this ever be supported? If so, is there some kind of estimate as to
> when?

I plan to work on this at some point, following Markus' suggestion in https://bugs.eclipse.org/bugs/show_bug.cgi?id=315964#c7.

It's hard to give a time estimate. There are many open bugs in CDT, and not that many people fixing them; I'm working through the indexer-related ones in my spare time. Hopefully sometime in 2015.

If you'd like it fixed sooner, you're welcome to write a patch yourself. I can try to give you guidance (here in the bug, or on the mailing list) and review your patch.
Comment 4 Nicklas Hansson CLA 2014-10-27 14:22:23 EDT
(In reply to Nathan Ridge from comment #3)
> (In reply to Nicklas Hansson from comment #2)
> > Will this ever be supported? If so, is there some kind of estimate as to
> > when?
> 
> I plan to work on this at some point, following Markus' suggestion in
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=315964#c7.
> 
> It's hard to give a time estimate. There are many open bugs in CDT, and not
> that many people fixing them; I'm working through the indexer-related ones
> in my spare time. Hopefully sometime in 2015.
> 
> If you'd like it fixed sooner, you're welcome to write a patch yourself. I
> can try to give you guidance (here in the bug, or on the mailing list) and
> review your patch.

I tried to get the environment going because I'd like to contribute to CDT. I ran into some issues with the test environment but it seems fine now. Anyway, is there some type of architectural description available somewhere or is it more deep diving into the code that's the strategy for getting started?

I suppose this discussion would be more suitable for the mailing list, but with some basic pointers regarding architecture above would be good and any further questions can be taken through the mailing list (or forums?).
Comment 5 Nathan Ridge CLA 2014-10-27 15:04:03 EDT
(In reply to Nicklas Hansson from comment #4)
> I tried to get the environment going because I'd like to contribute to CDT.
> I ran into some issues with the test environment but it seems fine now.
> Anyway, is there some type of architectural description available somewhere
> or is it more deep diving into the code that's the strategy for getting
> started?
> 
> I suppose this discussion would be more suitable for the mailing list, but
> with some basic pointers regarding architecture above would be good and any
> further questions can be taken through the mailing list (or forums?).

Unfortunately I'm not aware of much in the way of design documentation.

My suggestion for getting a feel for the architecture is to have a look at the patches for some bugs that are already fixed.

I think it's particularly helpful to look at a patch that implements a new language feature, albeit a small one so it's not overwhelming. For example, you could have a look at my patch in bug 411196 which adds support for the '__underlying_type(T)' compiler builtin that's commonly used to implement std::underlying_type in standard libraries. You can see the various parts of the code that are touched: adding a new token, adding a new AST node, modifying the parser to create the new AST node, adding new semantic entities (in this case, a new kind of type).

For this bug, most of the work involved will touch CPreprocessor and GNUCPPSourceParser, so it will probably help to familiarize yourself with these classes (obviously do not read all of GNUCPPSourceParser, just enough to get an idea for how it works).
Comment 6 Nathan Ridge CLA 2014-10-27 15:04:47 EDT
(In reply to Nicklas Hansson from comment #4)
> any further questions can be taken through the mailing list (or forums?).

Please ask any further questions either on the mailing list or in this bug. I don't read the forums.
Comment 7 Nathan Ridge CLA 2016-10-16 11:17:09 EDT
*** Bug 445183 has been marked as a duplicate of this bug. ***