# NORETURN attribute with FreeRTOS tasks

**URL:** <https://forums.freertos.org/t/noreturn-attribute-with-freertos-tasks/7138>\
**Category:** Kernel\
**Created:** [April 15, 2018, 1:08pm UTC](https://forums.freertos.org/t/noreturn-attribute-with-freertos-tasks/7138 "2018-04-15T13:08:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [April 15, 2018, 1:08pm UTC](https://forums.freertos.org/t/noreturn-attribute-with-freertos-tasks/7138/1 "2018-04-15T13:08:05Z")

</div>

**[user-andrey](https://sourceforge.net/u/user-andrey/)** wrote on [Sunday, April 15, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/b1a81e3d/#c0e6):

Hello,  
I’m using GNU GCC compiler for ARM processors (STM32F2).  
I’ve never met any example and couldn’t find any information about using ‘noreturn’ attribute with FreeRTOS tasks.  
I’ve noticed that the attribute makes some slight decrease in stack usage by the task, but is there any danger in using this attrubute?  
Thanks in advance.  
Best regards.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [April 15, 2018, 3:46pm UTC](https://forums.freertos.org/t/noreturn-attribute-with-freertos-tasks/7138/2 "2018-04-15T15:46:26Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, April 15, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/b1a81e3d/#c0e6/afa9):

I don’t think there is any danger in using the attribute - but have not  
done so myself for a very long time so can’t say for sure. There is a  
macro somewhere that allows tasks to be created with the option of a  
compiler specific attribute. Something like pdTASK\_FUNCTION( Function,  
Parameter ) and equivalent for the prototype.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [April 17, 2018, 6:03am UTC](https://forums.freertos.org/t/noreturn-attribute-with-freertos-tasks/7138/3 "2018-04-17T06:03:41Z")

</div>

**[user-andrey](https://sourceforge.net/u/user-andrey/)** wrote on [Tuesday, April 17, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/b1a81e3d/#914c):

Hello,  
I’d found the macros and they are: portTASK\_FUNCTION and portTASK\_FUNCTION\_PROTO.  
Thanks for the help.  
Best regards.
