Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: mem33-c now follows our convention wrt supplemtary rules

...

  1. The incomplete array type must be the last element within the structure.
  2. There cannot be an array of structures that contain a flexible array member.
  3. Structures that contain a flexible array member cannot be used as a member of another structure.
  4. The structure must contain at least one named member in addition to the flexible array member.

MEM33-C. Allocate and copy structures containing a flexible array member dynamically describes how to allocate and copy structures containing flexible array members.

Noncompliant Code Example

...

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Related Guidelines

...

This rule supplements MEM33-C. Allocate and copy structures containing a flexible array

...

member dynamically

Bibliography

[ISO/IEC 9899:2011]6.5.6, "Additive Operators"
6.7.2.1, "Structure and Union Specifiers"
[McCluskey 2001]"Flexible Array Members and Designators in C9X"

...