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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Language Extensions<br />

3.7.10 Inline<br />

The inline function qualifier specifies that the function is to be inlined.<br />

static inline foo (){...}<br />

foo is used internally to the file, and the symbol is not exported.<br />

inline foo(){...}<br />

foo is used internally to the file and an out of line version is made<br />

available and the name foo exported.<br />

extern inline foo (){...}<br />

In GNU mode, foo is used internally if it is inlined. If it is not inlined then<br />

an external version is referenced rather than using a call to the internal<br />

version. Also, the foo symbol is not emitted.<br />

In non-GNU mode, extern is ignored and the functionality is the same as<br />

inline foo() for C++. In C, you must use __inline. See Extern inline<br />

functions on page 5-19 for more information.<br />

Mode<br />

Supported in GNU mode only for C90.<br />

3.7.11 Extended lvalues<br />

The definition of what constitutes an lvalue when looking at comma expressions and :<br />

constructs is relaxed in GNU mode. You can use compound expressions, conditional<br />

expressions, and casts as follows:<br />

• You can assign a compound expression:<br />

(a++, b) += x;<br />

This is equivalent to:<br />

temp = (a++,b);<br />

b = temp + x<br />

• You can get the address of a compound expression &(a, b). This is equivalent to<br />

(a, &b).<br />

• You can use conditional expressions, for example:<br />

(a b : c) = a;<br />

This picks b or c as the destination dependent on a.<br />

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

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!