From owner-freebsd-current@FreeBSD.ORG Tue Jul 9 08:13:39 2013 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7923CEEF for ; Tue, 9 Jul 2013 08:13:39 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id 316221F43 for ; Tue, 9 Jul 2013 08:13:38 +0000 (UTC) Received: from [192.168.0.2] (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r698DFQ2089234 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 9 Jul 2013 08:13:16 GMT (envelope-from theraven@FreeBSD.org) Content-Type: multipart/signed; boundary="Apple-Mail=_5A46FA65-E6BA-4461-97EE-481C88DB19C4"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: another -Wunsequenced topic From: David Chisnall In-Reply-To: <6AC1186D-3D9C-4B7A-B5E4-4EA9CB120517@kientzle.com> Date: Tue, 9 Jul 2013 09:13:12 +0100 Message-Id: <374FC203-F5FB-4C7C-84D3-76A7AD507D90@FreeBSD.org> References: <51CEEC34.2010308@gmx.com> <51D03D27.3020100@gmx.com> <51DAA5FE.4040505@gmx.com> <6AC1186D-3D9C-4B7A-B5E4-4EA9CB120517@kientzle.com> To: Tim Kientzle X-Mailer: Apple Mail (2.1503) Cc: dt71@gmx.com, freebsd-current@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jul 2013 08:13:39 -0000 --Apple-Mail=_5A46FA65-E6BA-4461-97EE-481C88DB19C4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 9 Jul 2013, at 05:40, Tim Kientzle wrote: > However, this does have an implicit redundant store, > so changing it to >=20 > ptr =3D func(ptr + 1); >=20 > is still a good idea, just not for the reason Clang was claiming. If the compiler can tell that ptr has not escaped, then it will elide = the redundant store (typically, it will be gone as long as ptr is a = local and its address has not been passed out of the function), so there = should be no change to the generated code. However, I still agree that it is good style, because if I read the = original code I would be left wondering what the original programmer = expected the incremented value of ptr++ to be visible to and suspect a = more subtle error. =20 David --Apple-Mail=_5A46FA65-E6BA-4461-97EE-481C88DB19C4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQIcBAEBAgAGBQJR28YYAAoJEKx65DEEsqIdj6gP/jdC6pgahOjH/rP+cKoSuo2p Z5S3BcaFn7d0VNeqFxN29lxfqjvnqwXLcZg2G/p7u4Vkn78sXwUNqX9XjIk5QmVY 5LQ1qez6QLrpPKcmwC3yHaKuiPm0yThy4I/v/sRmEXgkFYw4JMuvOsfq0aWO4guj h7CtRXHkvxH7xx5RY4miWnow76W39IUSZFbidSWYmDydHrzIy/zgBzlQgnWg7NWI GGa6ESM7L7/1EQ61jSSBGxlW39Rfw8qQsBsrpg61rQs/7u/ZpKNpS9x3Cqy7npww eqwCePVa6DeVMYJgd3Lx8TNOR7jND7qjw4GcsLBk5zXK5lkpyK1tVc1AlL4eiEJJ wPiq91SIvwJgoNUT2qGYhlAxrDCqtkucPK46MG2hOD+tAv0FCCZKTcF/VtjA12uP eQnPDwyAIDHDGWJVBuRMny7mMv4jn+TpHIe1D+5NNYkQw8kPUbqCddsRgj3hJfaA og9hoV3EhKEbJTS574XjPw7AQaJrosJR8sRTKcm/fjMbEn7xylw0B0CU+NK/eH9s lQvBWRPwldzYONRq6FCMyaKMSD8U1ZsMQMg82hjN53e16PYU8dZGrkrxFU3OhBWf yFxeqWM5ez0x3YK/3lG7lqgDqzYm3m3IzdLfaogz/4ksdj4uzdObueCfnqVJCRBz 2dfonQ6HcbHM2B5H81/j =qg4B -----END PGP SIGNATURE----- --Apple-Mail=_5A46FA65-E6BA-4461-97EE-481C88DB19C4--