Skip to content

Commit fc56066

Browse files
committed
[8.6] Remove suppression, instead explain reporting
1 parent c5e10d1 commit fc56066

2 files changed

Lines changed: 29 additions & 32 deletions

File tree

MISRA.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ _Ref 8.6.1_
5252
- This rule prohibits an identifier with external linkage to have multiple
5353
definitions or no definition. FreeRTOS hook functions are implemented in
5454
the application and therefore, have no definition in the Kernel code.
55-
- Port layer function declarations are provided without corresponding
56-
implementations to provide for ease of porting to a device. These definitions
57-
cannot be implemented until a port is selected.
5855

5956
#### Rule 11.1
6057
MISRA C:2012 Rule 11.1: Conversions shall not be performed between a pointer to
@@ -150,10 +147,20 @@ _Ref 21.6.1_
150147

151148
### Unsupressed Deviations
152149

153-
Certain deviating code is left unsurpressed for awarness. This code should
154-
not be considered for usage in MISRA compliant applications. These violations
150+
Certain deviating code is left unsurpressed for awarness. These violations
155151
will be reported when audited by a MISRA-checking static analysis tool.
156152

153+
Some of these unsuppressed exceptions correspond to example code provided
154+
either for demonstration or verification of the FreeRTOS kernel. This code
155+
is not considered part of the kernel implemenation and should not be used
156+
in an application.
157+
158+
Other unsupressed violations are left present in the kernel implementation
159+
as implementations, code, or other missing functionality being flagged for
160+
violations will be present with the porting layer provided by the
161+
application. The presence of these errors after providing a port indicates
162+
a valid MISRA issue.
163+
157164
#### Rule 2.1
158165

159166
MISRA C:2012 Dir 2.1: A project shall not contain unreachable code
@@ -190,6 +197,17 @@ _Ref 4.12_
190197
Affected Files:
191198
- portable/MemMang/heap_*.c
192199

200+
201+
#### Rule 8.6
202+
203+
MISRA C:2012 Rule 8.6: An identifier with external linkage shall have exactly
204+
one external definition.
205+
206+
_Ref 8.6.1_
207+
- Port layer function declarations are provided without corresponding
208+
implementations to provide for ease of porting to a device. These definitions
209+
cannot be implemented until a port is selected.
210+
193211
#### Rule 21.3
194212

195213
MISRA C-2012 Rule 21.3: The memory allocation and deallocation functions of

include/portable.h

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -180,39 +180,18 @@ typedef struct xHeapStats
180180
/* coverity[misra_c_2012_rule_8_6_violation] */
181181
void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION;
182182

183+
/*
184+
* Returns a HeapStats_t structure filled with information about the current
185+
* heap state.
186+
*/
187+
void vPortGetHeapStats( HeapStats_t * pxHeapStats );
188+
183189
/*
184190
* Map to the memory management routines required for the port.
185191
*/
186-
/* MISRA Ref 8.6.1 [External linkage] */
187-
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
188-
/* coverity[misra_c_2012_rule_8_6_violation] */
189192
void * pvPortMalloc( size_t xWantedSize ) PRIVILEGED_FUNCTION;
190-
/* MISRA Ref 8.6.1 [External linkage] */
191-
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
192-
/* coverity[misra_c_2012_rule_8_6_violation] */
193193
void * pvPortCalloc( size_t xNum,
194194
size_t xSize ) PRIVILEGED_FUNCTION;
195-
/* MISRA Ref 8.6.1 [External linkage] */
196-
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
197-
/* coverity[misra_c_2012_rule_8_6_violation] */
198-
void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
199-
/* MISRA Ref 8.6.1 [External linkage] */
200-
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
201-
/* coverity[misra_c_2012_rule_8_6_violation] */
202-
void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
203-
/* MISRA Ref 8.6.1 [External linkage] */
204-
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
205-
/* coverity[misra_c_2012_rule_8_6_violation] */
206-
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
207-
/* MISRA Ref 8.6.1 [External linkage] */
208-
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
209-
/* coverity[misra_c_2012_rule_8_6_violation] */
210-
size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
211-
/* MISRA Ref 8.6.1 [External linkage] */
212-
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
213-
/* coverity[misra_c_2012_rule_8_6_violation] */
214-
void xPortResetHeapMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
215-
size_t xSize ) PRIVILEGED_FUNCTION;
216195
void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
217196
void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
218197
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;

0 commit comments

Comments
 (0)