29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

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.

<strong>Compiler</strong>-specific Features<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 0348A Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. 4-23<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!