MISRAC++2023-8.2.10_a
In this section:
Synopsis
(Required) Functions shall not call themselves, either directly or indirectly
Enabled by default
Yes
Severity/Certainty
Low/Low

Full description
There are functions that call themselves directly. This check is identical to MISRAC++2008-7-5-4_a, MISRAC2004-16.2_a, MISRAC2012-Rule-17.2_a.
Coding standards
- MISRA C:2004 16.2
(Required) Functions shall not call themselves, either directly or indirectly.
- MISRA C:2012 Rule-17.2
(Required) Functions shall not call themselves, either directly or indirectly
- MISRA C++ 2008 7-5-4
(Advisory) Functions should not call themselves, either directly or indirectly.
Code examples
The following code example fails the check and will give a warning:
void example(void) {
example();
}
The following code example passes the check and will not give a warning about this issue:
void example(void) {
}