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

See also<br />

• __weak on page 4-21.<br />

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

This variable attribute marks a variable declaration as an alias that does not by itself<br />

require a definition to be given for the target symbol.<br />

Note<br />

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

Syntax<br />

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

Where target is the target symbol.<br />

Example<br />

In the following example, a is assigned the value of y through a weak reference:<br />

extern int y;<br />

static int x __attribute__((weakref("y")));<br />

void foo (void)<br />

{<br />

int a = x;<br />

...<br />

}<br />

Restrictions<br />

This attribute can only be used on variables that are declared as static.<br />

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