NORETURN attribute with FreeRTOS tasks

user-andrey wrote on Sunday, April 15, 2018:

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.

rtel wrote on Sunday, April 15, 2018:

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.

user-andrey wrote on Tuesday, April 17, 2018:

Hello,
I’d found the macros and they are: portTASK_FUNCTION and portTASK_FUNCTION_PROTO.
Thanks for the help.
Best regards.