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.1 __attribute__((alias))<br />

This function attribute enables you to specify multiple aliases for functions.<br />

Where a function is defined in the current translation unit, the alias call is replaced by a<br />

call to the function, and the alias is emitted alongside the original name. Where a<br />

function is not defined in the current translation unit, the alias call is replaced by a call<br />

to the real function. Where a function is defined as static, the function name is replaced<br />

by the alias name and the function is declared external if the alias name is declared<br />

external.<br />

Note<br />

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

Note<br />

Variables names might also be aliased using the corresponding variable attribute<br />

__attribute__((alias)).<br />

Syntax<br />

return-type newname([argument-list]) __attribute__((alias("oldname")));<br />

Where:<br />

oldname<br />

newname<br />

is the name of the function to be aliased<br />

is the new name of the aliased function.<br />

Example<br />

#include <br />

void foo(void)<br />

{<br />

printf("%s\n", __FUNCTION__);<br />

}<br />

void bar(void) __attribute__((alias("foo")));<br />

void gazonk(void)<br />

{<br />

bar(); // calls foo<br />

}<br />

See also<br />

• __attribute__((alias)) on page 4-47.<br />

4-32 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!