The __declspec(nothrow) attribute asserts that a call to a function never results in a C++ exception being propagated from the callee into the caller.
Note:
The __declspec keyword is deprecated.
This __declspec attribute has the function attribute equivalent
__attribute__((nothrow)).
The Arm® library headers
automatically add this qualifier to declarations of C functions that, according to the ISO C
Standard, can never throw an exception. However, there are some restrictions on the
unwinding tables produced for the C library functions that might throw an exception in a C++
context, for example, bsearch and qsort.
Usage
If the compiler knows that a function can never throw an exception, it might be able to generate
smaller exception-handling tables for callers of that function.
Restrictions
If a call to a function results in a C++ exception being propagated from the callee into the
caller, the behavior is undefined.
This modifier is ignored when not compiling with exceptions enabled.
Example
struct S
{
~S();
};
__declspec(nothrow) extern void f(void);
void g(void)
{
S s;
f();
}
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.