[cfe-dev] array has incomplete element type
Csaba Raduly via cfe-dev
cfe-dev at lists.llvm.org
Mon Jun 17 06:17:25 PDT 2019
Hi Frank,
Your question would be more appropriate on the cfe-users mailing list.
Have you tried moving the declaration of struct STRUCT STRUCT ( :) )
in of the declaration of frontArray[] ?
Csaba
On Mon, Jun 17, 2019 at 2:03 PM Frank Redeker via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>
> 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
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
--
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformat way
to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK)
More information about the cfe-dev
mailing list