Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 6.8.4 clarification of amplification
#2
We're not sure what distinction you are making between 1 & 2 - but they are basically the behaviour we require: A is non-compliant, B & C are compliant.

Basically we want to prevent returning a pointer/reference to a subobject of the class, whose lifetime may be longer than that of the object.

We also want to avoid the need for pointer tracing, so we're not interested in the source of B::ptr or what is subsequently done with the value returned by B::Get

Thanks for highlighting a real issue. We've noted that the wording of this rule may need clarification in the next issue.
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Messages In This Thread
RE: Rule 6.8.4 clarification of amplification - by misra cpp - 24-08-2025, 03:26 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)