From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Herring, Davis" Newsgroups: gmane.emacs.devel Subject: Re: Making 'eq' == 'eql' in bignum branch Date: Wed, 22 Aug 2018 13:22:46 +0000 Message-ID: <5344e795b8e6402998dd78df493862de@lanl.gov> References: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> <87lgaio7xd.fsf@tromey.com> <877em1cb0i.fsf@tromey.com> <765767b2-d2e5-a9a6-f724-d58ecf4847bb@cs.ucla.edu> <76081b5d-8c10-0a37-2c97-d4864c0faa80@cs.ucla.edu> <09153aed-361d-4f82-d9ac-b502314769ae@cs.ucla.edu> <83k1oldqao.fsf@gnu.org> <87r2irvk5f.fsf@gmail.com> <87k1ojv8oa.fsf@gmail.com> <62ffbb4d-97e8-1359-5b73-b6add8cc3d1c@cs.ucla.edu>, NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1534944123 9031 195.159.176.226 (22 Aug 2018 13:22:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 22 Aug 2018 13:22:03 +0000 (UTC) Cc: "emacs-devel@gnu.org" To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 22 15:21:59 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsT5C-0002Bf-IZ for ged-emacs-devel@m.gmane.org; Wed, 22 Aug 2018 15:21:58 +0200 Original-Received: from localhost ([::1]:59087 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsT7H-0006cu-6I for ged-emacs-devel@m.gmane.org; Wed, 22 Aug 2018 09:24:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsT7A-0006cZ-IO for emacs-devel@gnu.org; Wed, 22 Aug 2018 09:24:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsT74-0002Aq-Gm for emacs-devel@gnu.org; Wed, 22 Aug 2018 09:23:59 -0400 Original-Received: from proofpoint8.lanl.gov ([204.121.3.47]:45956) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsT70-000243-P8 for emacs-devel@gnu.org; Wed, 22 Aug 2018 09:23:52 -0400 Original-Received: from pps.filterd (proofpoint8.lanl.gov [127.0.0.1]) by proofpoint8.lanl.gov (8.16.0.21/8.16.0.21) with SMTP id w7MDMDOg066621; Wed, 22 Aug 2018 07:22:46 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lanl.gov; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=lanl; bh=/Zw96EMGKsSo581QQ5gC7y7wOqZ8yIgTuEs4qyJau9E=; b=e+nvUmUENa3nYhUACu8TWmw0xpnC1eejwz+p1oCBlgCBPiD/3p3zH4zpGABnLsLTi6fV B5m7pZ0xd887gJZX9fMZtI34PewBYUFHF0WkjsGPdryDTxMdyxlorQArCabTjxNMVXOm 6qWMzTXw4Q66EIZOo0/v03T3Xqi4Dwe7bwzlZtHSaUV679B584bFdzDaX08pW7J7bEUH x2syluL3C9teJ9ILWd+6FZEbY7GjJRk+qnPytRKFtzej/xshtn/kWUdi31KFV2QCO3wh ydjPbsvPIYWxttOSB6nWggvmNPKigl92m9R66ORY/Q7+AAFdgA4EZzekXss5VlmZzf75 qQ== Original-Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by proofpoint8.lanl.gov with ESMTP id 2kxg81p9aw-1; Wed, 22 Aug 2018 07:22:46 -0600 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay2.lanl.gov (Postfix) with ESMTP id ADC7FF05170; Wed, 22 Aug 2018 07:22:46 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay2.lanl.gov Original-Received: from EXG16-P-MBX02.win.lanl.gov (exg16-p-mbx02.win.lanl.gov [128.165.106.182]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 93908F04C34; Wed, 22 Aug 2018 07:22:46 -0600 (MDT) Original-Received: from EXG16-P-MBX03.win.lanl.gov (128.165.106.183) by EXG16-P-MBX02.win.lanl.gov (128.165.106.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1531.3; Wed, 22 Aug 2018 07:22:46 -0600 Original-Received: from EXG16-P-MBX03.win.lanl.gov ([fe80::7c23:7a54:2544:a5c4]) by EXG16-P-MBX03.win.lanl.gov ([fe80::7c23:7a54:2544:a5c4%2]) with mapi id 15.01.1531.004; Wed, 22 Aug 2018 07:22:46 -0600 Thread-Topic: Making 'eq' == 'eql' in bignum branch Thread-Index: AQHUJe8LD6NzhSV8GEm1qwYJaFkj56SksmolgAFAbQCAIfRMJoAA0Z4AgAAIcQCAAAPVgIAAAjyAgAAeAHeAAAN8I4ABi8NtgABGwc2AAGmVgIAAdEjxgABN6nw= In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [128.165.106.203] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-08-22_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=813 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808220137 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 204.121.3.47 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228804 Archived-At: > I was reading a blog post on C over/underruns, and I got to this bit: >=20 > Note that there is no value than can hold 2147483648, so if you > negate (int)0x80000000, you get (int)0x80000000 again. That is > something to look out for, because it means abs() returns a > negative value when fed -2147483648. >=20 > I didn't know that, [...] You still don't, because C doesn't work that way. Even writing (int)0x8000= 0000 (on a system with suitably-sized ints) is implementation-defined . Appl= ying - to it (on almost any system) is overflow and hence undefined behavio= r . Of course, you have observed the "correctness" of this statement, but that'= s because it has well-defined (if surprising) behavior in (at least) x86 as= sembly and, formally, that _happened_ = to be the manifestation of the undefined behavior (in the C implementation = of Emacs). On the gripping hand, when the compiler can't prove anything about an integ= er argument, it is reasonable for us to assume that this will be the behavi= or; this is far from the only place in Emacs where what is formally undefin= ed behavior is expected to "do the obvious thing". But it's wrong for "a b= log post on C" to say that is unconditionally the behavior. Davis=