[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved |
Date: |
Thu, 28 Jul 2016 15:03:56 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 07/28/2016 09:29 AM, Halil Pasic wrote:
>> You mean va_start, not start_va. And actually, C11 is clear that errno
>> is unspecified after library functions (but not macros) that don't
>> explicitly state otherwise. Since va_start() is a macro and not a
>> library function, that means va_start does NOT have carte blanche
>> permission to modify errno. For more reading on the topic:
>
> I also considered this function/macro thing but in the end I am not
> aware of anything in C11 what would prohibit va_start to modify errno --
> correct me if I'm wrong. With that it boils down to 'may' and relying on
> 'does not' means you are not covered by the standard C11 (but may
> be covered by something else -- in which case this should be documented
> in HACKING).
>
>>
>> http://austingroupbugs.net/view.php?id=384
>>
>
> This got rejected, or? Means that there is no willingness to introduce
> this guarantee at POSIX level?
>
That particular bug report was rejected because the POSIX folks decided
that the C11 wording was clear enough that va_start() was already
guaranteed to not mess with errno, so no additionally wording was needed
in POSIX.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved, Sascha Silbe, 2016/07/28