...
Wiki Markup |
---|
This compliant solution allows the structure to be treated as if it had declared the member {{data\[\]}} to be {{data\[array_size\]}} in a manner that conforms to the C99 standard. |
However, some restrictions apply:
- The incomplete array type must be the last element within the structure.
- There cannot be an array of structures that contain flexible array members.
- Structures that contain a flexible array member cannot be used as a member in the middle of another structure.
- The
sizeof
operator cannot be applied to a flexible array.
Risk Assessment
Failing to use the correct syntax can result in undefined behavior, although the incorrect syntax will work on most implementations.
...