NO

Author Topic: Invalid use of incomplete type  (Read 3850 times)

jiake

  • Guest
Invalid use of incomplete type
« 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):
Code: [Select]
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):
Code: [Select]
typedef struct {
    int dummy;
    union {
        int padding;
        int data[];
    };
} DUMMY_STRUCT;
Got an error message:
Quote
error #2065: Invalid use of incomplete type 'int []'.
I only found one such structure named WNODE_ALL_DATA in "wmistr.h" header until now.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2107
Re: Invalid use of incomplete type
« Reply #1 on: November 18, 2014, 09:26:12 AM »
Use -Ze option for that.
May the source be with you

jiake

  • Guest
Re: Invalid use of incomplete type
« Reply #2 on: November 18, 2014, 09:49:38 AM »
-Ze -Zx are all set by default.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Invalid use of incomplete type
« Reply #3 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.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

jiake

  • Guest
Re: Invalid use of incomplete type
« Reply #4 on: November 19, 2014, 03:34:36 AM »
See the attachment
« Last Edit: November 19, 2014, 03:52:32 AM by jiake »

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Invalid use of incomplete type
« Reply #5 on: November 19, 2014, 10:52:37 AM »
Upgrade to PellesC V.8.00 RC6
It will solve also SQLITE compiling problem.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide