Skip to main content

IAR Embedded Workbench for RISC-V 3.40

MISRAC++2008-7-5-4_a

In this section:
Synopsis

(Advisory) Functions should not call themselves, either directly or indirectly.

Enabled by default

No

Severity/Certainty

Low/Medium

lowmedium.png
Full description

There are functions that call themselves directly. This check is identical to MISRAC2004-16.2_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++ 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) {
}