#pragma options align, #pragma align
Specifies the alignment of data objects in storage, which avoids performance problems with misaligned data.
Option syntax .-power------. +-full-------+ >>- -q--align--=--+-bit_packed-+------------------------------->< +-mac68k-----+ +-natural----+ +-packed-----+ '-twobyte----'
Pragma syntax .-power------. +-full-------+ >>-#--pragma--align--(--+-bit_packed-+--)---------------------->< +-mac68k-----+ +-natural----+ +-packed-----+ +-twobyte----+ '-reset------'
-qalign=power
If you use the -qalign option more than once on the command line, the last alignment rule specified applies to the file.
The full suboption is the default to ensure compatibility with existing objects. If compatibility with earlier versions is not necessary, you should consider using natural alignment to improve potential application performance.
The pragma directives override the -qalign compiler option setting for a specified section of program source code. The pragmas affect all aggregate definitions that appear after a given pragma directive; if a pragma is placed inside a nested aggregate, it applies only to the definitions that follow it, not to any containing definitions. Any aggregate variables that are declared use the alignment rule that applied at the point at which the aggregate was defined, regardless of pragmas that precede the declaration of the variables. See below for examples.
None.
/* file2.c The default alignment rule is in effect */
typedef struct A A2;
#pragma options align=bit_packed /* bit_packed alignment rules are now in effect */
struct A {
int a;
char c;
}; #pragma options align=reset /* Default alignment rules are in effect again */
struct A A1; /* A1 and A3 are aligned using bit_packed alignment rules since */
A2 A3; /* this rule applied when struct A was defined */
/* file2.c The default alignment rule in effect is bit_packed */
struct A {
int a;
#pragma options align=power /* Applies to B; A is unaffected */
struct B {
char c;
double d;
} BB; /* BB uses power alignment rules */
} AA; /* AA uses bit_packed alignment rules /*