Philippe Mathieu-Daudé <phi...@redhat.com> writes:

> RFC series to follow Markus direction to simplify error
> propagation. Not sure it is worth it yet. It starts to
> be interesting when using the QEMU_WARN_UNUSED_RESULT
> attribute in the visitors, such:
>
> -- >8 --
> @@ -525,6 +533,7 @@ bool visit_type_uint8(Visitor *v, const char *name, 
> uint8_t *obj,
>   * Visit a uint16_t value.
>   * Like visit_type_int(), except clamps the value to uint16_t range.
>   */
> +QEMU_WARN_UNUSED_RESULT
>  bool visit_type_uint16(Visitor *v, const char *name, uint16_t *obj,
>                         Error **errp);

QEMU_WARN_UNUSED_RESULT is problematic with functions taking an Error **
argument, because using &error_abort or &error_fatal the intended way
triggers the warning.

Does that make &error_abort and &error_fatal bad ideas?  They do help
keeping the code concise in places...  Hundreds of places, according to
git-grep.

> ---
>
> But to get there we need to update the QAPI generators first :)


Reply via email to