Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is Fn4 example in AUTOSAR rule A7-5-2 correct?
#1
AUTOSAR rule A7-5-2 has the following example:
Code:
std::int32_t Fn4(std::int32_t number)
{
  if (number == 1)
  {
    number = number * Fn3(number - 1);  // Non-compliant
  }   
  return number;
}
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?
Reply


Messages In This Thread
Is Fn4 example in AUTOSAR rule A7-5-2 correct? - by limdor - 02-07-2026, 10:49 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)