Language Implementation
7-25
7
The following example shows alignment of a structure using the structure
tag
identifier
:
#pragma align my_structure
struct my_structure /* natural alignment */
{
char f1;
};
#pragma noalign my_structure2
struct my_structure2 /* no alignment; i.e. */
{ /* 1-byte alignment */
char f1;
};
#pragma align my_structure3 = 16
struct my_structure3 /* 16-byte alignment */
{
char f1;
};
The following example shows alignment of structures without
identifier
specification:
#pragma align
struct my_structure /* natural alignment */
{
char f1;
};
#pragma noalign
struct my_structure2 /* no alignment */
{
char f1;
};
#pragma align 16
struct my_structure3 /* 16-byte alignment */
{
char f1;
};