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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

Example<br />

void *frame_address(void)<br />

{<br />

static void *frm_addr;<br />

}<br />

frm_addr = __builtin_frame_address(0); // return the sp<br />

return frm_addr;<br />

See also<br />

• __builtin_return_address<br />

• __current_sp on page 4-70.<br />

4.7.6 __builtin_return_address<br />

This builtin function returns the return address of the current function.<br />

Note<br />

This builtin function is a GNU compiler extension that is supported by the <strong>ARM</strong><br />

compiler.<br />

Mode<br />

Supported in GNU mode only.<br />

Syntax<br />

void *__builtin_return_address(unsigned int val)<br />

Where:<br />

val<br />

is an unsigned integer evaluating to zero.<br />

Return value<br />

__builtin_return_address returns the value of the link register that is used in returning<br />

from the current function.<br />

Example<br />

void *return_address_(void)<br />

{<br />

static void *rtn_addr;<br />

<strong>ARM</strong> DUI 0348A Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. 4-67<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!