qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Halil Pasic <pasic@linux.vnet.ibm.com>
To: Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Michael Roth <mdroth@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, Cornelia Huck <cornelia.huck@de.ibm.com>,
	Max Reitz <mreitz@redhat.com>,
	Sascha Silbe <silbe@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved
Date: Fri, 29 Jul 2016 15:38:17 +0200	[thread overview]
Message-ID: <579B5C49.1040707@linux.vnet.ibm.com> (raw)
In-Reply-To: <579A733C.5050306@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2153 bytes --]



On 07/28/2016 11:03 PM, Eric Blake wrote:
> 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.
> 

Sadly, I still do not get it. I have re-read the relevant parts of N1570
and even had a conversation with the in house compiler team. The
compiler guy's opinion was also that there is no guarantee provided by
C11. In http://austingroupbugs.net/view.php?id=384 you stated in the
description that the code example provided there is not conforming. Your
last reply I read like you were wrong with that statement. I still do
not understand why were you wrong there. In fact, I could argue that you
were right, but I'm afraid the argument would be somewhat lengthy and
confusing, and I'm already feeling bad about taking so much of your time
with this. Since I'm  admittedly quite inexperienced in this field I
decided to just accept your the conclusion you and the POSIX guys
reached -- without fully understanding it.

Thanks again for your time.

Regards,
Halil



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2016-07-29 13:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27  9:24 [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved Sascha Silbe
2016-07-27 11:02 ` Markus Armbruster
2016-07-27 20:42 ` Eric Blake
2016-07-28 10:19   ` Markus Armbruster
2016-07-28 10:46     ` Halil Pasic
2016-07-28 14:56       ` Eric Blake
2016-07-28 15:29         ` Halil Pasic
2016-07-28 21:03           ` Eric Blake
2016-07-29 13:38             ` Halil Pasic [this message]
2017-01-09 14:50               ` Eric Blake
2017-01-09 18:27                 ` Halil Pasic
2017-01-09 21:13                   ` Eric Blake
2016-07-28 10:35   ` Sascha Silbe
2016-08-05  8:24     ` Markus Armbruster
2017-01-09  9:57       ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=579B5C49.1040707@linux.vnet.ibm.com \
    --to=pasic@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=silbe@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).