This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

incomplete type is not allowed in c99

Hello everyone,

I am implementing a protocol handler.
Within my code I have a (complete) struct typedefed to protocol_t

in a routine i want to use the typedef and some raw format, so I initialized the variable like followed:

union {
    protocol_t data;
    uint8_t raw[];
}buffer;


I have enabled c99 but get error: #70: incomplete type is not allowed anyway. In the documentation I read:
70: incomplete type is not allowed

Example:

    typedef struct {
      unsigned char size;
      char string[];
    } FOO;


By not declaring a size for the array in the structure, the compiler is not able to allocate a size of the structure. Incomplete types are permitted in --gnu and --c99 modes.
Why do I get the error even with --c99?

Alexander