[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: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 7/7] error: On abort, report where the error was created |
Date: |
Wed, 22 Jul 2015 08:13:05 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
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().
>
>> 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 :)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature