Skip to main content

IAR Embedded Workbench for RX 5.20

MISRAC2004-16.2_a

In this section:
Synopsis

(Required) Functions shall not call themselves, either directly or indirectly.

Enabled by default

Yes

Severity/Certainty

Low/Medium

lowmedium.png
Full description

Functions were found that call themselves directly. This check is identical to MISRAC++2008-7-5-4_a, MISRAC2012-Rule-17.2_a, MISRAC++2023-8.2.10_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.

MISRA C++ 2023 8.2.10

(Required) Functions shall 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) {
}