qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 7/7] error: On abort, report where the error was


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 7/7] error: On abort, report where the error was created
Date: Thu, 23 Jul 2015 13:22:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Eric Blake <address@hidden> writes:

> On 07/22/2015 07:54 AM, Markus Armbruster wrote:
>
>>>
>>>> +#define error_setg(errp, fmt, ...) \
>>>> +    error_setg_internal((errp), __FILE__, __LINE__, (fmt), ## __VA_ARGS__)
>>>> +void error_setg_internal(Error **errp, const char *src, int line,
>>>> +                         const char *fmt, ...) GCC_FMT_ATTR(4, 5);
>>>>  
>>>
>>>> +#define error_setg_errno(errp, os_error, fmt, ...)                      \
>>>> +    error_setg_errno_internal((errp), __FILE__, __LINE__, (os_error),   \
>>>> +                              (fmt), ## __VA_ARGS__)
>>>
>>> Nit - why the difference in \ alignment?
>> 
>> I'm dense today... difference between where and where?
>
> one space after error_setg(), aligned to far right after error_setg_errno().

Normalized.

>>> Nit - as used here, 'errp', 'fmt', and 'os_error' can be used
>>> unambiguously; you don't need '(errp)' given the context of a
>>> parenthesized comma-separated list (even if someone DID want to unusual
>>> by passing in '(a,b)' with a comma operator for their 'errp' argument,
>>> they'd have to supply the () because of the semantics of making the
>>> macro call).
>> 
>> I put parenthesis around macro parameters in the expansion pretty much
>> unthinkingly, because thought is expensive :)
>
> Of course, it doesn't hurt semantically to leave them in, and if you
> value the lower maintenance burden of less thinking, then the extra
> typing is not something I will reject :)

Thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]