mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Add MISRA suppressions for coverity
This commit is contained in:
parent
b52f825aea
commit
795941bacb
19
MISRA.md
19
MISRA.md
|
@ -115,6 +115,25 @@ _Ref 11.5.5_
|
||||||
because data storage buffers are implemented as uint8_t arrays for the
|
because data storage buffers are implemented as uint8_t arrays for the
|
||||||
ease of sizing, alignment and access.
|
ease of sizing, alignment and access.
|
||||||
|
|
||||||
|
#### Rule 14.3
|
||||||
|
|
||||||
|
MISRA C-2012 Rule 14.3: Controlling expressions shall not be invariant.
|
||||||
|
|
||||||
|
_Ref 14.3.1_
|
||||||
|
- The `configMAX_TASK_NAME_LEN` and `taskRESERVED_TASK_NAME_LENGTH` values
|
||||||
|
constant at compile time however can vary depending on build configuration.
|
||||||
|
This condition takes into account the build configuration of the system.
|
||||||
|
|
||||||
|
#### Rule 18.1
|
||||||
|
|
||||||
|
MISRA C-2012 Rule 18.1: A pointer resulting from arithmetic on a pointer operand
|
||||||
|
shall address an element of the same array as that pointer operand.
|
||||||
|
|
||||||
|
_Ref 18.1_
|
||||||
|
- The array access is limited to in-bounds values as the null termination
|
||||||
|
of the IDLE task name results in breaking from the loop. Alternatively, if
|
||||||
|
the size is smaller than the IDLE task name length, the loop will exit normally.
|
||||||
|
|
||||||
#### Rule 21.6
|
#### Rule 21.6
|
||||||
|
|
||||||
MISRA C-2012 Rule 21.6: The Standard Library input/output functions shall not
|
MISRA C-2012 Rule 21.6: The Standard Library input/output functions shall not
|
||||||
|
|
9
tasks.c
9
tasks.c
|
@ -3546,13 +3546,16 @@ static BaseType_t prvCreateIdleTasks( void )
|
||||||
TaskFunction_t pxIdleTaskFunction = NULL;
|
TaskFunction_t pxIdleTaskFunction = NULL;
|
||||||
UBaseType_t xIdleTaskNameIndex;
|
UBaseType_t xIdleTaskNameIndex;
|
||||||
|
|
||||||
|
/* MISRA Ref 18.1 [Configuration dependent invariant] */
|
||||||
|
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-143 */
|
||||||
|
/* coverity[misra_c_2012_rule_14_3_violation] */
|
||||||
for( xIdleTaskNameIndex = 0U; xIdleTaskNameIndex < ( configMAX_TASK_NAME_LEN - taskRESERVED_TASK_NAME_LENGTH ); xIdleTaskNameIndex++ )
|
for( xIdleTaskNameIndex = 0U; xIdleTaskNameIndex < ( configMAX_TASK_NAME_LEN - taskRESERVED_TASK_NAME_LENGTH ); xIdleTaskNameIndex++ )
|
||||||
{
|
{
|
||||||
cIdleName[ xIdleTaskNameIndex ] = configIDLE_TASK_NAME[ xIdleTaskNameIndex ];
|
cIdleName[ xIdleTaskNameIndex ] = configIDLE_TASK_NAME[ xIdleTaskNameIndex ];
|
||||||
|
|
||||||
/* Don't copy all configMAX_TASK_NAME_LEN if the string is shorter than
|
/* MISRA Ref 18.1.1 [Configuration dependent bounds checking] */
|
||||||
* configMAX_TASK_NAME_LEN characters just in case the memory after the
|
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-181 */
|
||||||
* string is not accessible (extremely unlikely). */
|
/* coverity[misra_c_2012_rule_18_1_violation] */
|
||||||
if( cIdleName[ xIdleTaskNameIndex ] == ( char ) 0x00 )
|
if( cIdleName[ xIdleTaskNameIndex ] == ( char ) 0x00 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue