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

• In operations on pointers, a pointer to void is always implicitly converted to<br />

another type if necessary. Also, a null pointer constant is always implicitly<br />

converted to a null pointer of the right type if necessary. In ISO C, some operators<br />

permit these, and others do not.<br />

• Pointers to different function types can be assigned or compared for equality (==)<br />

or inequality (!=) without an explicit type cast. A warning or error is issued.<br />

This extension is prohibited in C++ mode.<br />

• A pointer to void can be implicitly converted to, or from, a pointer to a function<br />

type.<br />

• In an initializer, a pointer constant value can be cast to an integral type if the<br />

integral type is big enough to contain it.<br />

• A non lvalue array expression is converted to a pointer to the first element of the<br />

array when it is subscripted or similarly used.<br />

3.4.3 Block scope function declarations<br />

Two extensions to block scope function declarations are supported:<br />

• a block-scope function declaration also declares the function name at file scope<br />

• a block-scope function declaration can have static storage class, thereby causing<br />

the resulting declaration to have internal linkage by default.<br />

Example<br />

void f1(void)<br />

{<br />

static void g(void); /* static function declared in local scope */<br />

/* use of static keyword is illegal in strict ISO C */<br />

}<br />

void f2(void)<br />

{<br />

g(); /* uses previous local declaration */<br />

}<br />

static void g(int i)<br />

{ } /* error - conflicts with previous declaration of g */<br />

3-12 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!