>>57
Does not generalize well and depends on error codes.
If your error codes are negative, positive or whatever, the sum can be unpredictable and this could even be exploitable by a malicious user. However, your idea can work in some cases. Here's a variation on it which will always work as long as success error code is 0 and any non-zero return code is an error:
anyerror = 0
...
anyerror |= op(...);
...
anyerror |= op(...);
if (anyerror)
handle_failure(...);