| |||
| Home > Compiler Command-line Options > Command-line options > --min_array_alignment=opt | |||
This option enables you to specify the minimum alignment of arrays.
--min_array_alignment=opt
Where:
optspecifies the minimum alignment of arrays. The value
of is:opt
1byte alignment, or unaligned
2two-byte, halfword alignment
4four-byte, word alignment
8eight-byte, doubleword alignment.
Use of this option is not recommended, unless required in
certain specialized cases. For example, porting code to systems
that have different data alignment requirements. Use of this option
can result in increased code size at the higher values,
and reduced performance at the lower opt values.
If you only want to affect the alignment of specific arrays (rather
than all arrays), use the __align keyword instead.opt
Compiling the following code with --min_array_alignment=8 gives
the alignment described in the comments:
char arr_c1[1]; // alignment == 8 char c1; // alignment == 1