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

__weak void f(void);<br />

typedef void (*FP)(void);<br />

FP g() { return f; }<br />

// assume 'f' is not present in final link<br />

// 'g' returns non-NULL if<br />

// compiled and linked /ropi<br />

See also<br />

• Chapter 3 Using armar in the Utilities Guide for more information on library<br />

searching.<br />

4.1.20 __writeonly<br />

The __writeonly type qualifier indicates that a data object cannot be read from.<br />

In the C and C++ type system it behaves as a cv-qualifier like const or volatile. Its<br />

specific effect is that an lvalue with __writeonly type cannot be converted to an rvalue.<br />

Assignment to a __writeonly bitfield is not allowed if the assignment is implemented as<br />

read-modify-write. This is implementation-dependent.<br />

Example<br />

void foo(__writeonly int *ptr)<br />

{<br />

*ptr = 0;<br />

// allowed<br />

printf("ptr value = %d\n", *ptr); // error<br />

}<br />

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

ID101213<br />

Non-Confidential,

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

Saved successfully!

Ooh no, something went wrong!