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

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

#42-D: operand types are incompatible ("const int **" and "int **")<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, for<br />

example:<br />

#42-D: operand types are incompatible ("int (*)(char *)" and "unsigned int<br />

(*)(char *)")<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> Limited. All rights reserved. <strong>ARM</strong> DUI 0348A<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!