Btw, using goto to different labels is no good for modern CPUs as it spoils branch predictor. In classic Linux way it's usually goto to same "end" or "fail" label resulting in more efficient code. Let's hope compiler will rule this out. ;)
If you're going to embrace goto, why not go all the way and use multiple exit labels such that you can jump to appropriate point in the cleanup sequence and avoid those conditionals?
11 comments
[ 2.7 ms ] story [ 34.5 ms ] threadWhy "(ab)use" goto ? Use it with pleasure! Solution from Linus Torwalds:
1. This code is clean and neat.2. People should read Linux kernel source code as their go to sleep Bible verse.
And severely flawed. The (a == fopen...), etc, are certainly not doing what is apparently intended.