7.65 --force_new_nothrow, --no_force_new_nothrow

Controls the behavior of new expressions in C++.

The C++ standard states that only a no throw operator new declared with throw() is permitted to return NULL on failure. Any other operator new is never permitted to return NULL and the default operator new throws an exception on failure.
If you use --force_new_nothrow, the compiler treats expressions such as new T(...args...), that use the global ::operator new or ::operator new[], as if they are new (std::nothrow) T(...args...).
--force_new_nothrow also causes any class-specific operator new or any overloaded global operator new to be treated as no throw.


The option --force_new_nothrow is provided only as a migration aid for legacy source code that does not conform to the C++ standard. ARM does not recommend its use.


This option is effective only if the source language is C++.


The default is --no_force_new_nothrow.


struct S
    void* operator new(std::size_t);
    void* operator new[](std::size_t);
void *operator new(std::size_t, int);
With the --force_new_nothrow option in effect, this is treated as:
struct S
    void* operator new(std::size_t) throw();
    void* operator new[](std::size_t) throw();
void *operator new(std::size_t, int) throw();
Related reference
10.5 Using the ::operator new function in ARM C++
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.