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

roujesky wrote on Wednesday, October 31, 2018:

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…


rtel wrote on Wednesday, October 31, 2018:

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().

roujesky wrote on Thursday, November 01, 2018:

Thanks Richard, that fixed the warning.