02-07-2026, 10:49 AM
AUTOSAR rule A7-5-2 has the following example:
Fn3 is a recursive function and thus non-compliant. Fn4 is making a call to Fn3. However, in this line, the function is not calling itself. Why is this line Non-compliant? Is this an issue with the example?
Code:
std::int32_t Fn4(std::int32_t number)
{
if (number == 1)
{
number = number * Fn3(number - 1); // Non-compliant
}
return number;
}
