29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

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.

C and C++ Implementation Details<br />

See the description of C language mappings in the Procedure Call Standard for the<br />

<strong>ARM</strong> Architecture specification for more information.<br />

Note<br />

Care must be taken when mixing translation units that have been compiled with and<br />

without the --enum_is_int option, and that share interfaces or data structures.<br />

Handling values that are out of range<br />

In strict C, enumerator values must be representable as ints, for example, they must be<br />

in the range -2147483648 to +2147483647, inclusive. In previous releases of RVCT<br />

out-of-range values were cast to int without a warning (unless you specified the<br />

--strict option).<br />

In RVCT v2.2 and above, a Warning is issued for out-of-range enumerator values:<br />

#66: enumeration value is out of "int" range<br />

Such values are treated the same way as in C++, that is, they are treated as unsigned int,<br />

long long, or unsigned long long.<br />

To ensure that out-of-range Warnings are reported, use the following command to<br />

change them into Errors:<br />

armcc --diag_error=66 ...<br />

Structures<br />

The following points apply to:<br />

• all C structures<br />

• all C++ structures and classes not using virtual functions or base classes.<br />

Structure alignment<br />

The alignment of a non-packed structure is the maximum alignment<br />

required by any of its fields.<br />

Field alignment<br />

Structures are arranged with the first-named component at the lowest<br />

address. Fields are aligned as follows:<br />

• A field with a char type is aligned to the next available byte.<br />

• A field with a short type is aligned to the next even-addressed byte.<br />

5-8 Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0348A<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!