array has incomplete element type

Hello, List,

I'm using CLANG (6.0) to analyze C-Code that is written for a Windriver
Compiler.
Given the following piece of code.

extern const struct STRUCT Array;

typedef struct STRUCT {
  int Member;
} STRUCT;

int Foo (int i) {
  return Array[i].Member;
}

The Windriver compiler compiles this code without any problem (Does the
Windriver compiler violate an ANSI rule?). Buy when compiling which
clang it get
[error: array has incomplete element type 'const struct STRUCT']

(When compiling with clang++ the error goes away)

So my question is. Is there an option to handle the extern array in C
like in C++.

Frank

Hi Frank,

Your question would be more appropriate on the cfe-users mailing list.

Have you tried moving the declaration of struct STRUCT STRUCT ( :slight_smile: )
in of the declaration of frontArray ?

Csaba