4 ms·
CERT Secure Coding - Consider using Gotos
- makecheck 15y agoI can see how this works but it still looks unmaintainable. I avoid all goto, continue, early-return and similar statements though successive nesting. This solves problems: - Code quickly shows when it has become too complex and needs to be split up. - Code is naturally arranged in a way that makes it easier to split into functions. - Code is naturally arranged to clean up a resource only if it has been allocated (no extra labels) and as soon as it is no longer needed.