#  warning: 'noreturn' function does return \[enabled by default\]

**URL:** <https://forums.freertos.org/t/warning-noreturn-function-does-return-enabled-by-default/7492>\
**Category:** Kernel\
**Created:** [October 31, 2018, 8:06pm UTC](https://forums.freertos.org/t/warning-noreturn-function-does-return-enabled-by-default/7492 "2018-10-31T20:06:10Z")\
**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:** [October 31, 2018, 8:06pm UTC](https://forums.freertos.org/t/warning-noreturn-function-does-return-enabled-by-default/7492/1 "2018-10-31T20:06:10Z")

</div>

**[roujesky](https://sourceforge.net/u/roujesky/)** wrote on [Wednesday, October 31, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/72943186c8/#c661):

I created a new task. Doesn’t do very much. It gets the above warnting. The attached is all the source code. when I click on the warning, it takes me to the last line in the file(the last open paren). I have other tasks that seem to compile fine. I KNOW it has something to do with the protos that FreeRTOS needs… This is a Microchip project…

thanks!

---

<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:** [October 31, 2018, 10:04pm UTC](https://forums.freertos.org/t/warning-noreturn-function-does-return-enabled-by-default/7492/2 "2018-10-31T22:04:48Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, October 31, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/72943186c8/#c661/efd5):

If this warning is being generated then I’m going to guess that  
portTASK\_FUNCTION is defined as something like  
“ **attribute** ((no\_return))”, but the compiler doesn’t know that calling  
vTaskDelete() at the end of the function means the function indeed will  
never return. You could either change the function prototype to remove  
the portTASK\_FUNCTION, so it would be:

static void vFlashVersionTask( void \*pvParameters )  
{  
}

Or let the compiler know the function won’t return by adding the  
redundant code:

for( ;; );

after the call to vTaskDelete().

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 1, 2018, 2:54pm UTC](https://forums.freertos.org/t/warning-noreturn-function-does-return-enabled-by-default/7492/3 "2018-11-01T14:54:20Z")

</div>

**[roujesky](https://sourceforge.net/u/roujesky/)** wrote on [Thursday, November 01, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/72943186c8/#407c):

Thanks Richard, that fixed the warning.
