Add _Noreturn attribute in the template function to fix MISRA 17.11 advisory warnings

This commit is contained in:
kar-rahul-aws 2024-05-16 15:18:05 +05:30
parent c9e3949f02
commit b38b2dd9fb
2 changed files with 5 additions and 3 deletions

View file

@ -49,7 +49,7 @@ static void exampleTask( void * parameters );
/*-----------------------------------------------------------*/
static void exampleTask( void * parameters )
static _Noreturn void exampleTask( void * parameters )
{
/* Unused parameters. */
( void ) parameters;
@ -62,7 +62,7 @@ static void exampleTask( void * parameters )
}
/*-----------------------------------------------------------*/
void main( void )
int main( void )
{
static StaticTask_t exampleTaskTCB;
static StackType_t exampleTaskStack[ configMINIMAL_STACK_SIZE ];
@ -84,6 +84,8 @@ void main( void )
{
/* Should not reach here. */
}
return 0;
}
/*-----------------------------------------------------------*/

View file

@ -105,7 +105,7 @@ extern void vPortYield( void );
#define portYIELD() vPortYield()
/* Task function macros as described on the FreeRTOS.org WEB site. */
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) __attribute__( ( noreturn ) ) void vFunction( void * pvParameters )
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
#if ( configNUMBER_OF_CORES > 1 )