From 501ce1fadc7615f3789c4c114835a4b0c80c8e8d Mon Sep 17 00:00:00 2001 From: Kody Stribrny Date: Fri, 20 Feb 2026 13:43:34 -0800 Subject: [PATCH] [2.1] Justify unreachable code in example --- MISRA.md | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/MISRA.md b/MISRA.md index abe2bf92c..6a1a6402f 100644 --- a/MISRA.md +++ b/MISRA.md @@ -18,14 +18,6 @@ with ( Assuming rule 8.4 violation; with justification in point 1 ): grep 'MISRA Ref 8.4.1' . -rI ``` -#### Dir 2.2 - -MISRA C:2012 Dir 2.2: There shall be no dead code. - -_Ref 2.2_ - - `vPortEndScheduler` is erroneously determined to be dead code due to - simplified verification port. - #### Dir 4.7 MISRA C:2012 Dir 4.7: If a function returns error information, then that error @@ -162,6 +154,29 @@ Certain deviating code is left unsurpressed for awarness. This code should not be considered for usage in MISRA compliant applications. These violations will be reported when audited by a MISRA-checking static analysis tool. +#### Dir 2.1 + +MISRA C:2012 Dir 2.1: A project shall not contain unreachable code + +_Ref 2.1_ + - Simplified example contains unreachable code for demonstration of + freertos scheduler. A production implemenation should not contain + this. + + Affected Files: + - examples/cmake_example/main.c + +#### Dir 2.2 + +MISRA C:2012 Dir 2.2: There shall be no dead code. + +_Ref 2.2_ + - `vPortEndScheduler` is erroneously determined to be dead code due to + simplified verification port. + + Affected Files: + - tasks.c + #### Rule 21.3 MISRA C-2012 Rule 21.3: The memory allocation and deallocation functions of