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 />

4.3.14 __attribute__((unused))<br />

The unused function attribute prevents the compiler from generating warnings if the<br />

function is not referenced. This does not change the behavior of the unused function<br />

removal process.<br />

Note<br />

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

compiler.<br />

Example<br />

static int Function_Attributes_unused_0(int b) __attribute__ ((unused));<br />

4.3.15 __attribute__((used))<br />

This function attribute informs the compiler that a static function is to be retained in the<br />

object file, even if it is unreferenced.<br />

Static functions marked as used are emitted to a single section, in the order they are<br />

declared. You can specify the section functions are placed in using<br />

__attribute__((section)).<br />

Note<br />

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

compiler.<br />

Note<br />

Static variables can also be marked as used using __attribute__((used)).<br />

Example<br />

static int lose_this(int);<br />

static int keep_this(int) __attribute__((used)); // retained in object file<br />

static int keep_this_too(int) __attribute__((used)); // retained in object file<br />

See also<br />

• __attribute__((section("name"))) on page 4-38.<br />

• __attribute__((used)) on page 4-54.<br />

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

ID101213<br />

Non-Confidential,

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

Saved successfully!

Ooh no, something went wrong!