From: Ben Hutchings <b...@decadent.org.uk> Date: Wed, 17 Feb 2016 00:24:51 +0000
> I agree that 'if (err) goto cleanup;' is widely used and is generally > understandable (though more creative uses of goto are often not). > > My objection was to 'err = -EFOO; if (cond) goto cleanup;'. That is > definitely not clear and it hides mistakes like this. I don't see any difference whatsoever. Part of the convention of the cleanup blob at the end of the function is that error propagate to it's return statement via a variable. If this code wanted to handle that in more than one way, it is the problem of this function, not of the convention itself.