04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

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.

Compiler-specific Features<br />

Note<br />

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

compiler.<br />

Syntax<br />

__attribute__((nonnull(arg-index, ...)))<br />

Where arg-index, ... denotes the argument index list.<br />

If no argument index list is specified, all pointer arguments are marked as nonnull.<br />

Example<br />

The following declarations are equivalent:<br />

void * my_memcpy (void *dest, const void *src, size_t len)<br />

__attribute__((nonnull (1, 2)));<br />

void * my_memcpy (void *dest, const void *src, size_t len)<br />

__attribute__((nonnull));<br />

4.3.10 __attribute__((noreturn))<br />

This function attribute informs the compiler that the function does not return. The<br />

compiler can then perform optimizations by removing the code that is never reached.<br />

Note<br />

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

compiler. It has the __declspec equivalent __declspec(noreturn). However,<br />

__attribute((noreturn)) and __declspec(noreturn) differ in that when compiling a<br />

function definition, if the function reaches an explicit or implicit return,<br />

__attribute((noreturn)) is ignored and the compiler generates a warning. This does not<br />

apply to __declspec(noreturn).<br />

Example<br />

int Function_Attributes_NoReturn_0(void) __attribute__ ((noreturn));<br />

See also<br />

• __declspec(noreturn) on page 4-28.<br />

4-36 Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. <strong>ARM</strong> DUI 0348C<br />

Non-Confidential,<br />

ID101213

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

Saved successfully!

Ooh no, something went wrong!