29.10.2014 Views

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Compiler</strong> Coding Practices<br />

5.31 <strong>Compiler</strong> storage of data objects by natural byte alignment<br />

By default, <strong>the</strong> compiler stores data objects by byte alignment as shown in Table 5-9.<br />

Table 5-9 <strong>Compiler</strong> storage of data objects by byte alignment<br />

Type Bytes Alignment<br />

char, bool,<br />

_Bool.<br />

short,<br />

wchar_t.<br />

float, int,<br />

long,<br />

pointer.<br />

long long,<br />

double, long<br />

double.<br />

1 Located at any byte address.<br />

2 Located at any address that is evenly divisible by 2.<br />

4 Located at an address that is evenly divisible by 4.<br />

8 Located at an address that is evenly divisible by 8.<br />

5.31.1 See also<br />

Concepts<br />

• Advantages of natural data alignment on page 5-42<br />

• Relevance of natural data alignment at compile time on page 5-44.<br />

<strong>ARM</strong> DUI 0375C Copyright © 2007-2008, 2011 <strong>ARM</strong>. All rights reserved. 5-43<br />

ID061811<br />

Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!