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 Function attributes<br />

The __attribute__ keyword enables you to specify special attributes of variables or<br />

structure fields, functions, and types. The keyword format is either:<br />

__attribute__ ((attribute1, attribute2, ...))<br />

__attribute__ ((__attribute1__, __attribute2__, ...))<br />

For example:<br />

void * Function_Attributes_malloc_0(int b) __attribute__ ((malloc));<br />

static int b __attribute__ ((__unused__));<br />

Table 4-3 summarizes the available function attributes.<br />

Table 4-3 Function attributes supported by the compiler and their equivalents<br />

Function attribute<br />

non-attribute equivalent<br />

__attribute__((alias)) -<br />

__attribute__((always_inline))<br />

__attribute__((const))<br />

__forceinline<br />

__pure<br />

__attribute__((deprecated)) -<br />

__attribute__((malloc)) -<br />

__attribute__((noinline))<br />

__declspec(noinline)<br />

__attribute__((no_instrument_function))<br />

__attribute__((nomerge)) -<br />

__attribute__((nonnull))<br />

__attribute__((noreturn))<br />

__declspec(noreturn))<br />

__attribute__((notailcall)) -<br />

__attribute__((pure)) -<br />

__attribute__((unused)) -<br />

__attribute__((used)) -<br />

__attribute__((visibility("visibility_type")))<br />

__attribute__((weak))<br />

__weak<br />

__attribute__((weakref("target")))<br />

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

ID101213<br />

Non-Confidential,

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

Saved successfully!

Ooh no, something went wrong!