Skip to content

Commit c5e10d1

Browse files
committed
[4.12] Explain deviation for dynamic allocation
1 parent a9dc113 commit c5e10d1

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

MISRA.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Certain deviating code is left unsurpressed for awarness. This code should
154154
not be considered for usage in MISRA compliant applications. These violations
155155
will be reported when audited by a MISRA-checking static analysis tool.
156156

157-
#### Dir 2.1
157+
#### Rule 2.1
158158

159159
MISRA C:2012 Dir 2.1: A project shall not contain unreachable code
160160

@@ -166,23 +166,22 @@ _Ref 2.1_
166166
Affected Files:
167167
- examples/cmake_example/main.c
168168

169-
#### Dir 2.2
169+
#### Rule 2.2
170170

171171
MISRA C:2012 Dir 2.2: There shall be no dead code.
172172

173173
_Ref 2.2_
174174
- `vPortEndScheduler` is erroneously determined to be dead code due to
175-
simplified verification port.
175+
the use of a simplified verification port.
176176

177177
Affected Files:
178178
- tasks.c
179179

180-
#### Rule 21.3
180+
#### Dir 4.12
181181

182-
MISRA C-2012 Rule 21.3: The memory allocation and deallocation functions of
183-
<stdlib.h> shall not be used.
182+
MISRA C:2012 Dir 4.12: Dynamic allocation shall not be used
184183

185-
_Ref 21.3_
184+
_Ref 4.12_
186185
- Heap memory solutions utilize pvPortMalloc/vPortFree to provide heap
187186
memory for dynamic object allocation. These functions may rely upon
188187
the malloc/free of the underlying port. Static allocation is reccomended
@@ -191,6 +190,17 @@ _Ref 21.3_
191190
Affected Files:
192191
- portable/MemMang/heap_*.c
193192

193+
#### Rule 21.3
194+
195+
MISRA C-2012 Rule 21.3: The memory allocation and deallocation functions of
196+
<stdlib.h> shall not be used.
197+
198+
_Ref 21.3_
199+
- See justification from Directive 4.12
200+
201+
Affected Files:
202+
- portable/MemMang/heap_*.c
203+
194204
#### Rule 21.6
195205

196206
MISRA C-2012 Rule 21.6: The Standard Library input/output functions shall not

0 commit comments

Comments
 (0)