Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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:

  1. The incomplete array type must be the last element within the structure.
  2. There cannot be an array of structures that contain flexible array members.
  3. Structures that contain a flexible array member cannot be used as a member in the middle of another structure.
  4. 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.

...