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.5 Variable 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 on page 4-31 summarizes the available variable attributes.<br />

Table 4-5 Variable attributes supported by the compiler and their equivalents<br />

Variable attribute<br />

non-attribute equivalent<br />

__attribute__((alias)) -<br />

__attribute__((at(address))) -<br />

__attribute__((aligned)) -<br />

__attribute__((deprecated)) -<br />

__attribute__((noinline)) -<br />

__attribute__((packed)) -<br />

__attribute__((section(“name”))) -<br />

__attribute__((transparent_union)) -<br />

__attribute__((unused)) -<br />

__attribute__((used)) -<br />

__attribute__((weak))<br />

__weak<br />

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

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

__attribute__((zeroinit)) -<br />

4.5.1 __attribute__((alias))<br />

This variable attribute enables you to specify multiple aliases for variables.<br />

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

ID101213<br />

Non-Confidential,

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

Saved successfully!

Ooh no, something went wrong!