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

Create successful ePaper yourself

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

Language Extensions<br />

This is most useful if the test modifies the value in some way, for example:<br />

i++ : j;<br />

where i++ comes from a macro. If you write code in this way, then i++ is evaluated only<br />

once.<br />

If the original value of i is nonzero, the result is the original value of i. Regardless of<br />

this, i is incremented once.<br />

Mode<br />

Supported in GNU mode only. Supported languages are C90, C99 and C++.<br />

3.7.8 Designated inits<br />

As in C99, designated initializers are supported.<br />

Example<br />

int a[6] = { [4] = 29, [2] = 15 };<br />

int b[6] = { 0,0,15,0,29,0 }; // a[] is equivalent to b[]<br />

Mode<br />

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

See also<br />

• New features of C99 on page 5-45 in the Compiler User Guide.<br />

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

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

Non-Confidential,<br />

ID101213

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

Saved successfully!

Ooh no, something went wrong!