8.131 --min_array_alignment=opt

Specifies the minimum alignment of arrays.

Syntax

--min_array_alignment=opt

Where:

opt

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

1

byte alignment, or unaligned

2

two-byte, halfword alignment

4

four-byte, word alignment

8

eight-byte, doubleword alignment.

Usage

ARM does not recommend using this option, 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.

Default

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

Example

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
Non-ConfidentialPDF file icon PDF versionARM DUI0472M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.