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

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

5.2 C++ implementation details<br />

This section describes language implementation details specific to C++.<br />

5.2.1 Using the ::operator new function<br />

In accordance with the ISO C++ Standard, the ::operator new(std::size_t) throws an<br />

exception when memory allocation fails rather than raising a signal. If the exception is<br />

not caught, std::terminate() is called.<br />

The compiler option --force_new_nothrow turns all new calls in a compilation into calls<br />

to ::operator new(std::size_t, std::nothrow_t&) or :operator new[](std::size_t,<br />

std::nothrow_t&). However, this does not affect operator new calls in libraries, nor calls<br />

to any class-specific operator new. See --force_new_nothrow, --no_force_new_nothrow<br />

on page 2-57 for more information.<br />

Legacy support<br />

In RVCT v2.0, when the ::operator new function ran out of memory, it raised the signal<br />

SIGOUTOFHEAP, instead of throwing a C++ exception. See ISO C library<br />

implementation definition on page 2-97 in the Libraries and Floating Point Support<br />

Guide.<br />

In the current release, it is possible to install a new_handler to raise a signal and so restore<br />

the RVCT v2.0 behavior.<br />

Note<br />

Do not rely on the implementation details of this behavior, because it might change in<br />

future releases.<br />

5.2.2 Tentative arrays<br />

The ADS v1.2 and RVCT v1.2 C++ compilers enabled you to use tentative, that is,<br />

incomplete array declarations, for example, int a[]. You cannot use tentative arrays<br />

when compiling C++ with the RVCT v2.x compilers or above.<br />

5.2.3 Old-style C parameters in C++ functions<br />

The ADS v1.2 and RVCT v1.2 C++ compilers enabled you to use old-style C<br />

parameters in C++ functions. That is,<br />

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

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

ID101213<br />

Non-Confidential,

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

Saved successfully!

Ooh no, something went wrong!