\r
static void prvTaskExitError( void )\r
{\r
+volatile uint32_t ulDummy = 0;\r
+\r
/* A function that implements a task must not exit or attempt to return to\r
its caller as there is nothing to return to. If a task wants to exit it\r
should instead call vTaskDelete( NULL ).\r
defined, then stop here so application writers can catch the error. */\r
configASSERT( uxCriticalNesting == ~0UL );\r
portDISABLE_INTERRUPTS();\r
- for( ;; );\r
+ while( ulDummy == 0 )\r
+ {\r
+ /* This file calls prvTaskExitError() after the scheduler has been\r
+ started to remove a compiler warning about the function being defined\r
+ but never called. ulDummy is used purely to quieten other warnings\r
+ about code appearing after this function is called - making ulDummy\r
+ volatile makes the compiler think the function could return and\r
+ therefore not output an 'unreachable code' warning for code that appears\r
+ after it. */\r
+ }\r
}\r
/*-----------------------------------------------------------*/\r
\r
functionality by defining configTASK_RETURN_ADDRESS. Call\r
vTaskSwitchContext() so link time optimisation does not remove the\r
symbol. */\r
- prvTaskExitError();\r
vTaskSwitchContext();\r
+ prvTaskExitError();\r
\r
/* Should not get here! */\r
return 0;\r