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

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

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!