Re: [Qemu-devel] [PATCH v2 2/5] char: Clean up fragile use of error_is_set()

2014-05-19 Thread Eric Blake
On 05/19/2014 10:57 AM, Markus Armbruster wrote: > Using error_is_set(ERRP) to find out whether a function failed is > either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP > may be null, because errors go undetected when it is. It's fragile > when proving ERRP non-null involves a

[Qemu-devel] [PATCH v2 2/5] char: Clean up fragile use of error_is_set()

2014-05-19 Thread Markus Armbruster
Using error_is_set(ERRP) to find out whether a function failed is either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP may be null, because errors go undetected when it is. It's fragile when proving ERRP non-null involves a non-local argument. Else, it's unnecessarily opaque (see