Re: question on common error-handling idiom

From: Oliver Neukum
Date: Tue Nov 02 2004 - 16:24:15 EST



> but for the places that do
>
> err = -SOMEERROR;
> if (condition)
> goto out;
>
> err = -OTHERERROR;
> if (condition)
> goto out;
>
> I would tend to agree with you that moving the setting of the error inside
> the if() would make sense.

The intention is to allow the compiler to turn the if into a simple
conditional branch on the assumption that gcc is not smart enough
to put the if's body out of line.

Regards
Oliver
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/