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

3.2 C99 language features available in C90<br />

The compiler supports numerous extensions to the ISO C90 standard, for example,<br />

C99-style // comments.<br />

These extensions are available if the source language is C90 and you are compiling in<br />

non strict mode.<br />

These extensions are not available if the source language is C90 and the compiler is<br />

restricted to compiling strict C90 using the --strict compiler option.<br />

Note<br />

Language features of Standard C and Standard C++, for example C++-style //<br />

comments, might be similar to the C90 language extensions described in this section.<br />

Such features continue to remain available if you are compiling strict Standard C or<br />

strict Standard C++ using the --strict compiler option.<br />

3.2.1 // comments<br />

The character sequence // starts a one line comment, like in C99 or C++.<br />

// comments in C90 have the same semantics as // comments in C99.<br />

Example<br />

// this is a comment<br />

See also<br />

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

3.2.2 Subscripting struct<br />

In C90, arrays that are not lvalues still decay to pointers, and can be subscripted.<br />

However, you must not modify or use them after the next sequence point, and you must<br />

not apply the unary & operator to them. Arrays of this kind can be subscripted in C90,<br />

but they do not decay to pointers outside C99 mode.<br />

Example<br />

struct Subscripting_Struct<br />

{<br />

int a[4];<br />

};<br />

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

ID101213<br />

Non-Confidential,

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

Saved successfully!

Ooh no, something went wrong!