Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 66C4D10838 for ; Wed, 8 Jan 2014 16:27:06 +0000 (UTC) Received: (qmail 83107 invoked by uid 500); 8 Jan 2014 16:26:46 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 83064 invoked by uid 500); 8 Jan 2014 16:26:45 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 83050 invoked by uid 99); 8 Jan 2014 16:26:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jan 2014 16:26:44 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [76.96.30.16] (HELO qmta01.emeryville.ca.mail.comcast.net) (76.96.30.16) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jan 2014 16:26:38 +0000 Received: from omta04.emeryville.ca.mail.comcast.net ([76.96.30.35]) by qmta01.emeryville.ca.mail.comcast.net with comcast id BS5v1n0020lTkoCA1USJHs; Wed, 08 Jan 2014 16:26:18 +0000 Received: from [192.168.199.10] ([69.251.80.74]) by omta04.emeryville.ca.mail.comcast.net with comcast id BUSG1n0011cCKD98QUSHHc; Wed, 08 Jan 2014 16:26:18 +0000 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: Event and atomics, round II From: Jim Jagielski In-Reply-To: Date: Wed, 8 Jan 2014 11:26:15 -0500 Cc: httpd , apr Content-Transfer-Encoding: quoted-printable Message-Id: <719A69AF-DBF5-4C1E-9B7B-CEF7AB87B180@jaguNET.com> References: <0A8DAAF8-2078-4766-87B7-45F0CF3DFF23@jaguNET.com> <337B63DA-90A8-4EA7-A333-74BA9B76585A@jaguNET.com> To: Yann Ylavic X-Mailer: Apple Mail (2.1827) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1389198378; bh=71T8QgZEkseve5b/WFgajo+X9jx28KQvMhBip+S7xfA=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To; b=Wsc5Sbli6W5YNHxT+hsQ/ybgFpO2cVLkTZzEVlQ518ctJyaMhFv9LrJ+kxhy6pBkK xvVN+3+Bv8U2ByFiGeSr3HPCsR/dTUSzzoCl3Er4V+HlnGQ9Xvgp5WmeO9aszIY7+h CR2jsdCG/KNCkpTyDRq+doHzrUDsuGZXvuJfivXo8hKo4vB+s2zrrL2XyGXVOnDQGu rtg94SVyX12EFxCy5z8QgTu+MhP1G04HanIho7mdnjQwz+WhpjDf7OZ8AZ9CmyqQpu TX6iTjHsghYXyCx0pevdNZmTrWgMIRJI7ySJdGNBczPkLWzbz1UsFCE34yF3dsCUps WQQkNYIvvspqw== X-Virus-Checked: Checked by ClamAV on apache.org If the unsigned quantity can be expressed as a signed quantity, then all is well. The only undefined behavior (implementation specific) is if it can't be. However, the conversion from a non-0 quantity to a 0 would be extremely unlikely. You'd get an unexpected signed value, but I can't imagine any compiler turning it into a 0! On Jan 8, 2014, at 10:57 AM, Yann Ylavic wrote: > On Wed, Jan 8, 2014 at 2:03 PM, Jim Jagielski wrote: >=20 > On Jan 7, 2014, at 3:15 PM, Jeff Trawick wrote: > > > > +1 for APR trunk, +0.9 for future APR 1.6.x, -0.9 for APR 1.5.x... > > > > alternate opinions? > > >=20 > As far as I know, C guarantees that >=20 > if (a) >=20 > is the same as >=20 > if (a !=3D 0) >=20 > So I'm unsure of the need for this patch. >=20 > The real question is, for an "unsigned a !=3D 0", can "(int)a" become = 0 after an implicit (undefined) conversion? >=20 > Regards, > Yann.