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.

C and C++ Implementation Details<br />

In the RVCT v2.x compilers or above, you must use the --anachronisms compiler option<br />

if your code contains any old-style parameters in functions. The compiler warns you if<br />

it finds any instances.<br />

5.2.4 Anachronisms<br />

The following anachronisms are accepted when you enable anachronisms using the<br />

--anachronisms option:<br />

• overload is permitted in function declarations. It is accepted and ignored.<br />

• Definitions are not required for static data members that can be initialized using<br />

default initialization. The anachronism does not apply to static data members of<br />

template classes, because these must always be defined.<br />

• The number of elements in an array can be specified in an array delete operation.<br />

The value is ignored.<br />

• A single operator++() and operator--() function can be used to overload both<br />

prefix and postfix operations.<br />

• The base class name can be omitted in a base class initializer if there is only one<br />

immediate base class.<br />

• Assignment to the this pointer in constructors and destructors is permitted.<br />

• A bound function pointer, that is, a pointer to a member function for a given<br />

object, can be cast to a pointer to a function.<br />

• A nested class name can be used as a non-nested class name provided no other<br />

class of that name has been declared. The anachronism is not applied to template<br />

classes.<br />

• A reference to a non-const type can be initialized from a value of a different type.<br />

A temporary is created, it is initialized from the converted initial value, and the<br />

reference is set to the temporary.<br />

• A reference to a non const class type can be initialized from an rvalue of the class<br />

type or a class derived from that class type. No, additional, temporary is used.<br />

• A function with old-style parameter declarations is permitted and can participate<br />

in function overloading as if it were prototyped. Default argument promotion is<br />

not applied to parameter types of such functions when the check for compatibility<br />

is done, so that the following declares the overloading of two functions named f:<br />

int f(int);<br />

int f(x) char x; { return x; }<br />

5-14 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!