hisf_0004: Protect against recursive function calls to improve code compliance
R2026bAvoid recursive function calls to promote bounded call behavior in generated code
Usage: High-Integrity System Modeling
Guideline ID: hisf_0004
Prerequisite: hisl_0311: Configuration Parameters > Diagnostics > Stateflow, hisl_0060: Configuration parameters that improve MISRA C compliance, hisf_0011: Stateflow debugging settings
Rules
| hisf_0004: Protect against recursive function calls to improve code compliance |
|---|
To improve compliance of generated code, do not call functions recursively. This includes any combination of graphical functions, truth table functions, MATLAB® functions, or Simulink® functions. Rationale Promote bounded function call behavior. Verification Check usage of recursions (Simulink Check) Example There are multiple patterns in Stateflow® that can result in recursion.
When the default state A is entered, event
Example
|
Tips
A recursion exists when a function calls itself directly or indirectly through another function call.
Industry Standards
IEC 61508-3, Table B.1 (6) 'Limited use of recursion'
IEC 62304, 5.5.3 - Software Unit acceptance criteria
ISO 26262-6, Table 6 (1j) 'No recursions'
EN 50128, Table A.12 (6) 'Limited Use of Recursion'
EN 50657, Table A.12 (6) 'Limited Use of Recursion'
DO-331, Section MB.6.3.2.g 'Algorithms are accurate'
DO-331, Section MB.6.3.3.d 'Software architecture is verifiable'MISRA C:2012, Rule 17.2
MISRA C:2023, Rule 17.2

