10.43 __attribute__((noreturn)) function attribute

This function attribute informs the compiler that the function does not return. The compiler can then perform optimizations by removing the code that is never reached.

Note

This function attribute is a GNU compiler extension that the ARM compiler supports. It has the __declspec equivalent __declspec(noreturn). However, __attribute((noreturn)) and __declspec(noreturn) differ in that when compiling a function definition, if the function reaches an explicit or implicit return, __attribute((noreturn)) is ignored and the compiler generates a warning. This does not apply to __declspec(noreturn).

Examples

int Function_Attributes_NoReturn_0(void) __attribute__((noreturn));
Related reference
10.26 __declspec(noreturn)
Non-Confidential PDF file icon PDF version ARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.