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

Where:<br />

return-type<br />

is the type of a structure of up to four words in size.<br />

Usage<br />

Declaring a function __value_in_regs can be useful when calling functions that return<br />

more than one result.<br />

Restrictions<br />

A C++ function cannot return a __value_in_regs structure if the structure requires copy<br />

constructing.<br />

If a virtual function declared as __value_in_regs is to be overridden, the overriding<br />

function must also be declared as __value_in_regs. If the functions do not match, the<br />

compiler generates an error.<br />

Errors<br />

Where the structure returned in a function qualified by __value_in_regs is too big, a<br />

warning is produced and the __value_in_regs structure is then ignored.<br />

Example<br />

typedef struct int64_struct<br />

{<br />

unsigned int lo;<br />

unsigned int hi;<br />

} int64_struct;<br />

__value_in_regs extern<br />

int64_struct mul64(unsigned a, unsigned b);<br />

See also<br />

• __value_in_regs on page 4-14 in the <strong>Compiler</strong> User <strong>Guide</strong>.<br />

4.1.19 __weak<br />

This keyword instructs the compiler to export symbols weakly.<br />

The __weak keyword can be applied to function and variable declarations, and to<br />

function definitions.<br />

4-20 Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0348A<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!