| |
ID | STAT-13 |
Title | All fields of a struct shall be defined in a single, contiguous block of code. |
Priority | Strongly recommended |
Severity level | 5 when the code is meant for code generation, otherwise 9 |
Description | No fields shall be added to a struct after using it. |
Rationale | Lines of code or functions using the struct might assume that all fields are already there, resulting in an error if the field is not there. |
s = struct("f", 2, "g", 3);
computeCost(s);
s.h = 'new field';
s = struct("f", 2, "g", 3, "h", 'new field');
computeCost(s);