i960 Processor Compiler User's Guide
7-22
7
#pragma align [for ic960, or for gcc960 with ic960 option]
#pragma align [ [(]
size
[)]]
#pragma align [(]
identifier
[=
size
][,...][)]
#pragma noalign [ [(]
identifier
[,...][)] ]
size
specifies the alignment value in bytes. Any of
the following values are valid:
1, 2, 4, 8, or 16.
identifier
specifies the structure tag used in struct type
specifiers, as described in C: A Reference
Manual.
NOTE. This pragma functions differently with the gcc960 and ic960
drivers.
Specifies alignment values for structures and unions.
Default
The default is optimal natural alignment.
Discussion
Use #pragma align to align structure members using the natural
alignment value or a specified alignment size. Use
#pragma noalign to
specify byte alignment only.
#pragma noalign is equivalent to #pragma
align
with a size of 1. The align and noalign pragmas specify
alignment values for
struct types.
The alignment pragma applies to the whole structure; you cannot specify
differing alignments for individual structure members. If you do not
specify
size
, the compiler uses natural alignment.
Since the scope of an alignment pragma is all subsequent source text,
nesting declarative scopes does not affect an existing alignment.
However, you can place an alignment pragma within a structure
declaration, so that the pragma affects any subsequent nested or top-level
structure declaration.