Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Goto to simulate Exceptions
#3
As wrote by sparker: it isn't MISRA.

But just two remarks:

Quote:3. It provides a single exit point. This is a major problem in the "return" method since if there is a resource to release it needs to be done before each return.
All resources should not be got on function entry. So the resources to release on exit point, may be dependent to the executed path.

ylehman Wrote:4. The code is MUCH cleaner and robust
I'm not agree because the control flow is hidden and not clear:
The code appears like a functions call sequence (only one code path), but in fact no! Otherwise, this tips may come less readable when the bar_aaa function will be callded inside a nested conditionnal test.


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)