26-06-2007, 11:24 AM
As wrote by sparker: it isn't MISRA.
But just two remarks:
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.
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 robustI'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.