04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

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.

Compiler-specific Features<br />

Note<br />

This variable attribute is a GNU compiler extension that is supported by the <strong>ARM</strong><br />

compiler.<br />

Example<br />

int Variable_Attributes_aligned_0 __attribute__ ((aligned (16)));<br />

/* aligned on 16 byte boundary */<br />

short Variable_Attributes_aligned_1[3] __attribute__ ((aligned));<br />

/* aligns on 4 byte boundary for <strong>ARM</strong> */<br />

See also<br />

• __align on page 4-2.<br />

4.5.4 __attribute__((deprecated))<br />

The deprecated variable attribute enables the declaration of a deprecated variable<br />

without any warnings or errors being issued by the compiler. However, any access to a<br />

deprecated variable creates a warning but still compiles. The warning gives the location<br />

where the variable is used and the location where it is defined. This helps you to<br />

determine why a particular definition is deprecated.<br />

Note<br />

This variable attribute is a GNU compiler extension that is supported by the <strong>ARM</strong><br />

compiler.<br />

Example<br />

extern int Variable_Attributes_deprecated_0 __attribute__ ((deprecated));<br />

extern int Variable_Attributes_deprecated_1 __attribute__ ((deprecated));<br />

void Variable_Attributes_deprecated_2()<br />

{<br />

Variable_Attributes_deprecated_0=1;<br />

Variable_Attributes_deprecated_1=2;<br />

}<br />

Compiling this example generates two warning messages.<br />

4-50 Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. <strong>ARM</strong> DUI 0348C<br />

Non-Confidential,<br />

ID101213

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

Saved successfully!

Ooh no, something went wrong!