[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


align_array_members

Description:

Controls the alignment of arrays within struct and class data.

Compatibility:

This pragma is compatible with the following platform targets:

68K

PowerPC

NEC V800
Intel x86
MIPS

Embedded 68K

Prototype:
  #pragma align_array_members on | off | reset Remarks:

This option lets you choose how to align an array in a struct or class. If this option is on, the compiler aligns all array fields larger than a byte according to the setting of the Struct Alignment option. If this option is off, the compiler doesn't align array fields.

Choosing how to align arrays:
#pragma align_array_members off
struct X1 {
        char c;        // offset==0
        char arr[4];    // offset==1 (char aligned)
};

#pragma align_array_members on
#pragma align mac68k
struct X2 {
        char c;        // offset==0
        char arr[4];    // offset==2 (2-byte align)
};

#pragma align_array_members on
#pragma align mac68k4byte
struct X3 {
        char c;        // offset==0
        char arr[4];    // offset==4 (4-byte align)
};

To check whether this option is on, use __option (align_array_members), described in "Checking Options." By default, this option is off.


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 17, 2000