[4.12] Explain deviation for dynamic allocation

This commit is contained in:
Kody Stribrny 2026-02-20 14:05:51 -08:00
parent ce00f074dc
commit 34d51f74b7

View file

@ -154,7 +154,7 @@ Certain deviating code is left unsurpressed for awarness. This code should
not be considered for usage in MISRA compliant applications. These violations not be considered for usage in MISRA compliant applications. These violations
will be reported when audited by a MISRA-checking static analysis tool. will be reported when audited by a MISRA-checking static analysis tool.
#### Dir 2.1 #### Rule 2.1
MISRA C:2012 Dir 2.1: A project shall not contain unreachable code MISRA C:2012 Dir 2.1: A project shall not contain unreachable code
@ -166,27 +166,37 @@ _Ref 2.1_
Affected Files: Affected Files:
- examples/cmake_example/main.c - examples/cmake_example/main.c
#### Dir 2.2 #### Rule 2.2
MISRA C:2012 Dir 2.2: There shall be no dead code. MISRA C:2012 Dir 2.2: There shall be no dead code.
_Ref 2.2_ _Ref 2.2_
- `vPortEndScheduler` is erroneously determined to be dead code due to - `vPortEndScheduler` is erroneously determined to be dead code due to
simplified verification port. the use of a simplified verification port.
Affected Files: Affected Files:
- tasks.c - tasks.c
#### Dir 4.12
MISRA C:2012 Dir 4.12: Dynamic allocation shall not be used
_Ref 4.12_
- Heap memory solutions utilize pvPortMalloc/vPortFree to provide heap
memory for dynamic object allocation. These functions may rely upon
the malloc/free of the underlying port. Static allocation is reccomended
for MISRA compliant applications.
Affected Files:
- portable/MemMang/heap_*.c
#### Rule 21.3 #### Rule 21.3
MISRA C-2012 Rule 21.3: The memory allocation and deallocation functions of MISRA C-2012 Rule 21.3: The memory allocation and deallocation functions of
<stdlib.h> shall not be used. <stdlib.h> shall not be used.
_Ref 21.3_ _Ref 21.3_
- Heap memory solutions utilize pvPortMalloc/vPortFree to provide heap - See justification from Directive 4.12
memory for dynamic object allocation. These functions may rely upon
the malloc/free of the underlying port. Static allocation is reccomended
for MISRA compliant applications.
Affected Files: Affected Files:
- portable/MemMang/heap_*.c - portable/MemMang/heap_*.c