diff options
author | chinglee-iot <61685396+chinglee-iot@users.noreply.github.com> | 2023-11-28 16:34:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-28 16:34:29 +0300 |
commit | dabbc05a39977e1d414b9885f5ee4f8c32c74691 (patch) | |
tree | 3c403dab3693eab8696c91a55875f1ebaad4d5e1 /tasks.c | |
parent | f2637bae55405b11c8ea80e919bfab16ef4dd26b (diff) |
Suppress MISRA C rule 11.3 in MISRA.md (#857)
Suppress MISRA C rule 11.3 in MISRA.md
Diffstat (limited to 'tasks.c')
-rw-r--r-- | tasks.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1271,7 +1271,10 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION; { /* The memory used for the task's TCB and stack are passed into this * function - use them. */ - pxNewTCB = ( TCB_t * ) pxTaskBuffer; /*lint !e740 !e9087 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */ + /* MISRA Ref 11.3.1 [Misaligned access] */ + /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */ + /* coverity[misra_c_2012_rule_11_3_violation] */ + pxNewTCB = ( TCB_t * ) pxTaskBuffer; ( void ) memset( ( void * ) pxNewTCB, 0x00, sizeof( TCB_t ) ); pxNewTCB->pxStack = ( StackType_t * ) puxStackBuffer; @@ -4354,6 +4357,9 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB ) { *ppuxStackBuffer = pxTCB->pxStack; + /* MISRA Ref 11.3.1 [Misaligned access] */ + /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */ + /* coverity[misra_c_2012_rule_11_3_violation] */ *ppxTaskBuffer = ( StaticTask_t * ) pxTCB; xReturn = pdTRUE; } |