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

Bug 329425

Summary: Issue handling #include within a struct
Product: [Tools] CDT Reporter: James Blackburn <jamesblackburn+eclipse>
Component: cdt-parserAssignee: Project Inbox <cdt-parser-inbox>
Status: CLOSED DUPLICATE QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description James Blackburn CLA 2010-11-04 07:40:22 EDT
We've got some embedded application code that is raising lots of codan errors of field can't be resolved.  What they're doing is #include'ing a header within a struct which appears to confused the parser.

e.g.:

foo.h:
MY_DEF(a, b, c)

foo.c:
#define MY_DEF(X,Y,Z) int X;
typedef struct tag_FooType
{
  #include "foo.h"
} Foo;
Foo foo;


void main() {
	foo.a  = 1;            // <= parser error here
}

Substituting MY_DEF(a,b,c) for the #include makes the error go away.
Comment 1 Markus Schorn CLA 2010-11-05 04:55:47 EDT
Essentially the same as bug 315964.

*** This bug has been marked as a duplicate of bug 315964 ***