9.21 __writeonly

The __writeonly type qualifier indicates that a data object cannot be read from.

In the C and C++ type system it behaves as a cv-qualifier like const or volatile. Its specific effect is that an lvalue with __writeonly type cannot be converted to an rvalue.
Assignment to a __writeonly bitfield is not allowed if the assignment is implemented as read-modify-write. This is implementation-dependent.

Example

void foo(__writeonly int *ptr)
{
    *ptr = 0;                         // allowed
    printf("ptr value = %d\n", *ptr); // error
}
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.