Everything

-pack


< Compile Options / Microcontroller Options >

[Format]

-pack

 

-

[Default]

The default for this option is unpack. That is, the structure members and class members have boundary alignment values appropriate for their types. The boundary alignment value for structures and classes equals the maximum boundary alignment value for members.

[Description]

-

This option sets the boundary alignment value for structure members and class members to 1.

-

The boundary alignment value for structure members can also be set to 1 by using the #pragma pack directive. If this option and #pragma are specified together, the #pragma specification takes priority.

[Remarks]

-

The boundary alignment values for structure members and class members when these options are specified are shown in the following table.

Table 2.7

Boundary Alignment Values for Structure Members and Class Members When the pack Option is Specified

Member Type

pack specified

pack not specified

char/signed char/unsigned char/bool Note 1

1

1

signed short/unsigned short

1

2

signed int Note 2 /unsigned int Note 2 /signed long/unsigned long/

signed long long/unsigned long long/float/double/

long double/pointer type

1

4

Notes 1.

Becomes the same as unsigned long when the -lang=c option is specified.

Notes 2.

Becomes the same as signed short/unsigned short when the int_to_short option is specified.