Pelles C forum

Pelles C => Bug reports => Topic started by: jiake on November 18, 2014, 09:03:34 AM

Title: Invalid use of incomplete type
Post by: jiake on November 18, 2014, 09:03:34 AM
A structure including a zero element array can be compiled by Pelles C 7.00.355 (x64):
typedef struct {
    int dummy;
    int data[];
} DUMMY_STRUCT;

But a structure with a union including zero element array can't be compiled by Pelles C 7.00.355 (x64):
typedef struct {
    int dummy;
    union {
        int padding;
        int data[];
    };
} DUMMY_STRUCT;

Got an error message:
Quoteerror #2065: Invalid use of incomplete type 'int []'.
I only found one such structure named WNODE_ALL_DATA in "wmistr.h" header until now.
Title: Re: Invalid use of incomplete type
Post by: TimoVJL on November 18, 2014, 09:26:12 AM
Use -Ze option for that.
Title: Re: Invalid use of incomplete type
Post by: jiake on November 18, 2014, 09:49:38 AM
-Ze -Zx are all set by default.
Title: Re: Invalid use of incomplete type
Post by: frankie on November 18, 2014, 10:58:31 AM
It works.
The error should be not in the declaration, but in the usage of the struct.
Post a compilable short piece of code to check.
Title: Re: Invalid use of incomplete type
Post by: jiake on November 19, 2014, 03:34:36 AM
See the attachment
Title: Re: Invalid use of incomplete type
Post by: frankie on November 19, 2014, 10:52:37 AM
Upgrade to PellesC V.8.00 RC6
It will solve also SQLITE compiling problem.