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.

<strong>Compiler</strong>-specific Features<br />

Restrictions<br />

The return address is not preserved when calling the noreturn function. This limits the<br />

ability of a debugger to display the call stack.<br />

Example<br />

__declspec(noreturn) void overflow(void); // never return on overflow<br />

int negate(int x)<br />

{<br />

if (x == 0x80000000) overflow();<br />

return -x;<br />

}<br />

See also<br />

• __attribute__((noreturn)) on page 4-33.<br />

4.2.5 __declspec(nothrow)<br />

The __declspec(nothrow) attribute asserts that a call to a function never results in a C++<br />

exception being propagated from the call into the caller.<br />

The <strong>ARM</strong> library headers automatically add this qualifier to declarations of C functions<br />

that, according to the ISO C Standard, can never throw.<br />

Usage<br />

If the compiler knows that a function can never throw out, it might be able to generate<br />

smaller exception-handling tables for callers of that function.<br />

Restrictions<br />

If a call to a function results in a C++ exception being propagated from the call into the<br />

caller, the behavior is undefined.<br />

This modifier is ignored when not compiling with exceptions enabled.<br />

Example<br />

struct S<br />

{<br />

~S();<br />

4-26 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!