From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT807-0007qP-0w for qemu-devel@nongnu.org; Fri, 29 Jul 2016 09:38:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bT804-0003kc-9U for qemu-devel@nongnu.org; Fri, 29 Jul 2016 09:38:55 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT804-0003k7-0c for qemu-devel@nongnu.org; Fri, 29 Jul 2016 09:38:52 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6TDTQgk035319 for ; Fri, 29 Jul 2016 09:38:51 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 24fcvxu5nc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 29 Jul 2016 09:38:51 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 29 Jul 2016 14:38:48 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id DB34B2190046 for ; Fri, 29 Jul 2016 14:38:11 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6TDcj5X23986282 for ; Fri, 29 Jul 2016 13:38:45 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u6TDciGO003033 for ; Fri, 29 Jul 2016 07:38:45 -0600 References: <1469611466-31574-1-git-send-email-silbe@linux.vnet.ibm.com> <57991CC1.40003@redhat.com> <87twfaysit.fsf@dusky.pond.sub.org> <5799E26B.7090408@linux.vnet.ibm.com> <579A1D33.6010500@redhat.com> <579A24BE.2060707@linux.vnet.ibm.com> <579A733C.5050306@redhat.com> From: Halil Pasic Date: Fri, 29 Jul 2016 15:38:17 +0200 MIME-Version: 1.0 In-Reply-To: <579A733C.5050306@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fdOpdbvSqwGjKKvqa0H4dlMd86JBn6SqB" Message-Id: <579B5C49.1040707@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Markus Armbruster Cc: Kevin Wolf , Michael Roth , qemu-devel@nongnu.org, Cornelia Huck , Max Reitz , Sascha Silbe This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fdOpdbvSqwGjKKvqa0H4dlMd86JBn6SqB From: Halil Pasic To: Eric Blake , Markus Armbruster Cc: Kevin Wolf , Michael Roth , qemu-devel@nongnu.org, Cornelia Huck , Max Reitz , Sascha Silbe Message-ID: <579B5C49.1040707@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved References: <1469611466-31574-1-git-send-email-silbe@linux.vnet.ibm.com> <57991CC1.40003@redhat.com> <87twfaysit.fsf@dusky.pond.sub.org> <5799E26B.7090408@linux.vnet.ibm.com> <579A1D33.6010500@redhat.com> <579A24BE.2060707@linux.vnet.ibm.com> <579A733C.5050306@redhat.com> In-Reply-To: <579A733C.5050306@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/28/2016 11:03 PM, Eric Blake wrote: > On 07/28/2016 09:29 AM, Halil Pasic wrote: >=20 >>> You mean va_start, not start_va. And actually, C11 is clear that err= no >>> 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 documente= d >> in HACKING). >> >>> >>> http://austingroupbugs.net/view.php?id=3D384 >>> >> >> This got rejected, or? Means that there is no willingness to introduce= >> this guarantee at POSIX level? >> =20 >=20 > 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 neede= d > in POSIX. >=20 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=3D384 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 --fdOpdbvSqwGjKKvqa0H4dlMd86JBn6SqB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iQIcBAEBAgAGBQJXm1xkAAoJEA0vhuyXGx0ApgUP/2kgHhKKoxIxgApLS9xoWIIA ph2yor/wYeZBo9oxvVxgODf9/73MdvSTngdP5k0a61VFDyroKYhkqimAIr+z6xF/ dyLpBlfz7ae8rPH+bLL3bpDS0Sw6ahb97DUX+I3DLdyDS/hVJdOB+cdZLl2EQSe+ J4xIZv/AOvTZCLdPxGAFMgOokO+6DfF68CTSvnBfvJDJlGDz+d4eefwTzP6Z51+o /8ZBxwo9rsOrqkKuiIHpn5zTMYLmPYfUbul5e91p/UJLr+tHv66XsQVUtYWMWbRw tHE1uk9Rt184EFX87/t+XHR08Onptbf5k0ufOOpt9Ns5QHX6xsPuUWbAGxxKVdDA CGceTe+hCm/SVr3OOloDNCEJon21lol901dgE20D0tSd9bm8UrTpRd2f/liDHUeO 3CKv6W9nY64gmbuFzgHzWHVHvh5YrZgHaYdhmYfGsKOo5hgjpAB5//DzZiE7JAMQ IJWF6+gusyma0LKAKFjk5+lwmsybsYEJd5277N7+FJWGwFcVFp1VGkr3y9K82/i3 PSD5bnPYWwbzyjZ9Sr3gwldCHCJ42Tjg+t0knpK1sAKW0YPxGW5AhKNJca87tUo7 cP03D6QKGi1015Sc+me5E1w6Zdheub509OgNuytVLcxrqPpt+v5tyJE/sfuMlN9D W/CxHDwv/ggV35Jau9wH =NFrA -----END PGP SIGNATURE----- --fdOpdbvSqwGjKKvqa0H4dlMd86JBn6SqB--