i960 Processor Compiler User's Guide
7-24
7
/* 2-byte boundaries and is the largest*/
/* member of inner2; thus the default */
/* alignment of inner2 is 2. */
int i2;
};
#pragma noalign (outer3) /* outer3 is packed. */
struct outer3 {
struct { /* Since the inner structure has no tag, it*/
short s; /* is aligned the same as the immediately */
char c ; /* enclosing structure, outer3. Thus both */
} si1; /* structures are packed. */
int i2;
};
The following example shows nested unnamed structure definitions and
alignment pragmas:
#pragma align my_structure = 16
struct my_structure /* 16-byte alignment */
{
char f1;
struct /* 16-byte alignment */
{
int ff2;
} f2;
};
#pragma align my_structure2 = 16
struct my_structure2 /* 16-byte alignment */
{
char f1;
#pragma align 4
struct /* 16-byte alignment */
{
int ff2;
} f2;
};
/* If no more alignment pragmas appear, any subsequent
* structs have 4-byte alignment.
*/