--min_array_alignment=opt

This option enables you to specify the minimum alignment of arrays.

Show/hideSyntax

--min_array_alignment=opt

Where:

opt

specifies the minimum alignment of arrays. The value of opt is:

1

byte alignment, or unaligned

2

two-byte, halfword alignment

4

four-byte, word alignment

8

eight-byte, doubleword alignment.

Show/hideUsage

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 opt 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.

Show/hideDefault

If you do not use this option, arrays are unaligned (byte aligned).

Show/hideExample

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

Show/hideSee also

Copyright © 2007-2008, 2011 ARM. All rights reserved.ARM DUI 0376C
Non-ConfidentialID061811