Data Definition Language (DDL) Reference Manual
DDL Alignment Rules for C
Data Definition Language (DDL) Reference Manual—529431-004
H-3
NOC00CALIGN Alignment Rules
NOC00CALIGN Alignment Rules
Versions of the C compiler earlier than C00 follow these 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 (adding filler 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), the DDL compiler 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 the DDL compiler 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.
C_MATCH_HISTORIC_TAL Alignment Rules
When you specify the CFIELDALIGN_MATCHED2 command, DDL uses the following
alignment rules:
•
If a substructure starts on an odd byte boundary or has an odd length, and refers
to a previously defined structure, the DDL compiler inserts one or more fillers to
word-align the substructure and make its length even.
•
If a substructure defined in line starts on an odd byte boundary, the DDL compiler
aligns the data on an odd byte boundary.
The C_MATCH_HISTORIC_TAL command allows members of a structure to have
consecutive byte or word addresses. If the remaining byte in a two-byte word is not
large enough to accommodate the next member, then the DDL compiler assigns the
next word-aligned address. This condition also applies to a substructure that is
declared inline, using the first member of the substructure.
Note. The term substructure refers to either a structure or union within a structure
definition. The only data that the DDL compiler allocates starting on an odd byte is
character data.