DDL Alignment Rules
Data Definition Language (DDL) Reference Manual — 426798-002
H- 2
NOC00CALIGN Alignment Rules
{
char x[3];
} ss2;
char y;
} s1;
When C00CALIGN is in effect, DDL does not generate C output for a structure that
contains one of the following:
•
A substructure that begins on an odd byte boundary.
•
A structure that ends on an odd byte boundary and is followed by a user-defined
item that DDL allocates starting on an odd byte.
NOC00CALIGN Alignment Rules
Versions of the C compiler prior to C00 adhere to the following rules:
•
If a substructure contains any word aligned data (any data except for a char or char
array), then C aligns the substructure on word boundaries and uses an even length
(padding occurs before and after the structure as needed).
•
If a substructure contains no word aligned data (only
char
data,
char
array data,
or substructures containing only
char
or
char
array data, applied recursively),
DDL aligns the substructure on byte boundaries and does not include implicit filler.
When NOC00CALIGN is in effect, the DDL compiler does not generate C output for a
structure if the structure contains a substructure that contains a word-aligned item and
one of the following is true:
•
The substructure starts on an odd byte boundary.
•
The substructure ends on an odd byte boundary and is followed by a user-defined
item that DDL allocates starting on that odd byte.
•
The DDL compiler does not insert implicit filler between byte-aligned objects
except as defined by the preceding two rules.
Note. The term substructure refers to a structure or union within a structure definition. The
only data that DDL allocates starting on an odd byte is character data.
Note. The term substructure refers to either a structure or union within a structure
definition. The only data that DDL allocates starting on an odd byte is character data.