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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Language Extensions<br />

3.7.5 Character escape sequences<br />

In strings, the escape sequence ‘\e’ is accepted for the escape character (ASCII<br />

27).<br />

Example<br />

void foo(void)<br />

{<br />

printf("Escape sequence is: \e\n");<br />

}<br />

3.7.6 Compound literals<br />

As in C99, compound literals are supported. All compound literals are lvalues.<br />

Example<br />

int y[] = (int []) {1, 2, 3}; // error in strict C99, okay in C99 --gnu<br />

int z[] = (int [3]) {1};<br />

Mode<br />

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

Note<br />

Compound literals can also be used as initializers in C99. However, the compiler is<br />

more relaxed about which compound literals it accepts as initializers in GNU mode than<br />

it is when compiling C99 source code.<br />

3.7.7 Conditionals<br />

The middle operand in a conditional statement can be omitted, if the result is to be the<br />

same as the test.<br />

for example:<br />

Example<br />

The following statements are equivalent:<br />

c = i : j; // middle operand omitted<br />

c = i i : j;<br />

if (i) c = i; else c = j; // expanded in full<br />

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

ID101213<br />

Non-Confidential,

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

Saved successfully!

Ooh no, something went wrong!