__declspec(nothrow)

The __declspec(nothrow) attribute asserts that a call to a function never results in a C++ exception being propagated from the call into the caller.

The ARM library headers automatically add this qualifier to declarations of C functions that, according to the ISO C Standard, can never throw.

Show/hideUsage

If the compiler knows that a function can never throw out, it might be able to generate smaller exception-handling tables for callers of that function.

Show/hideRestrictions

If a call to a function results in a C++ exception being propagated from the call into the caller, the behavior is undefined.

This modifier is ignored when not compiling with exceptions enabled.

Show/hideExample

struct S
{
    ~S();
};
__declspec(nothrow) extern void f(void);
void g(void)
{
    S s;
    f();
}

Show/hideSee also

Copyright © 2010-2012 ARM. All rights reserved.ARM DUI 0491G
Non-ConfidentialID021412