From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, URIBL_DBL_BLOCKED_OPENDNS,URIBL_ZEN_BLOCKED_OPENDNS autolearn=no autolearn_force=no version=3.4.4 Received: from minnie.tuhs.org (minnie.tuhs.org [IPv6:2600:3c01:e000:146::1]) by inbox.vuxu.org (Postfix) with ESMTP id 6C0442FDFD for ; Sat, 16 Aug 2025 01:58:52 +0200 (CEST) Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 63A8943C37; Sat, 16 Aug 2025 09:58:45 +1000 (AEST) Received: from mout.perfora.net (mout.perfora.net [74.208.4.197]) by minnie.tuhs.org (Postfix) with ESMTPS id 14E9843C36 for ; Sat, 16 Aug 2025 09:58:40 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=makerlisp.com; s=s1-ionos; t=1755302319; x=1755907119; i=luther.johnson@makerlisp.com; bh=YWAcCVveN+ZGyPVd2787CHXj+49gliszghhy8JvOiGs=; h=X-UI-Sender-Class:Subject:To:References:Cc:From:Message-ID:Date: MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=1V2m4+bl1BBh4bM53tMNhWJl2olYtk+Pmltsor+mmLlojk0T99I0fKdvGAUK5l4o QLYKxWrSMwa+72337auiwV42mgQ6OfQkJJcv67Rj6E9bONmnYuvPcCbM+nKqJGT/A iLH5hLRIaimEPnnYZl2KDgNrpcpUQx9IpKClic2NWdcIrFt80U1xxgvIGkz0e72UY Lb0cFtySnQuQJO2O1MtoRoEJ2410IkuU2b8aG7tT3r0OZY6Mka58OQvMPjUM3jQsh wGBBRot+PTaHW1Z2oO/DhyrsMRhqQQiLf7NUbpo3my9gqeG1Bgd5SDk0Rj/RK3Rvb 1gA8T09OcJDXfsjvjg== X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from mlhivps ([74.50.126.128]) by mrelay.perfora.net (mreueus003 [74.208.5.2]) with ESMTPSA (Nemesis) id 0Ltpw3-1ucj1f3dtF-0184My; Sat, 16 Aug 2025 01:58:38 +0200 Received: from [192.168.234.130] (unknown [172.56.176.94]) by mlhivps (Postfix) with ESMTPSA id 9E5F9480169; Fri, 15 Aug 2025 23:58:37 +0000 (UTC) To: Douglas McIlroy , John Levine References: <664f1cf9-ae56-11a5-1e94-f58e0ca23565@makerlisp.com> <20250815184408.E438DD7D00B1@ary.qy> From: Luther Johnson Message-ID: Date: Fri, 15 Aug 2025 16:58:36 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:7bYz7Du53QMI63YWOIizapbeL76E02MafmIf6h3THhN/H/mji5/ v0+73YqhmDTkFmcc1j9rZtR5JKFJBBVifFIgwEwQM3m3AtQLhmTj+x8Fg3wssr1UIDZHx0S +KGAX78WVQedxSrZ4gdYQdcLmUrK58kne6yPsOPU2ZmpIDJJ1gEwrrn6YMXrU57snX/Eh2T BnifwB6bAdumYfRiUzsAw== UI-OutboundReport: notjunk:1;M01:P0:1n2h2mfOCG0=;6B822mNhlcNkYn9ez/SgSHOehoG f+ky3j8pvJCFlDBF8ZFudGhAaRt1lKkAHuH1rhBTs7oBtNYBZZJIqF/I4yrbGuF/7WIDRl6UQ j6Meg6ywU9uWjZPwB7Dul7h0B0tBfQAoxyW7dvMGGppnjHv32W/NjQY9RaUeuVuNvvizmyXS9 3IK5KiHsQBj1+olc7mn7C3HESpdF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ndOPEUb3FCdfPEjfyl9D3PYpcVpUY+qlKtNZEZZaiF1kH/Dh6cMXXcRtjBNMc0Io IQ68sUt7z+e4NozjjCOYT4jQpLuA1oIrkPm0jr5U70Zd3e47WdXgjiidbIPrn2ZONwE+Oc3bf KUnzHf77/4fb1s9PkRmiGHdbyo5/C5Wj6PV/OJYKiiDDmeQ7psoeKuFNpD1OTUkWXpbVaeXOe XQQAiW5mYrOpSIAJGTmdmGbb3qbLzMhC1uwdmuNgox7mKRHy6m8UkCEUUHufDc6udxCO3uBos jTvGov9EG4YUHfPJxkwmo3Xl4+SY6WBv66Fk/2KVRbZ5LCUri1q2hHNW8G1QRmqtSGo7A2Kpi 3snnjvai7ShZGvI2qC00JknrGuFm5qfoVR339cbbgBc87k++LGtk0Xd9QvoC3u1qeZAc5w0aw aiMaYyKPCcIWE3QatADh0Q Message-ID-Hash: 6NEKA6M2QRQZW4MBGFRPKBKWPDAWTOCD X-Message-ID-Hash: 6NEKA6M2QRQZW4MBGFRPKBKWPDAWTOCD X-MailFrom: luther.johnson@makerlisp.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-tuhs.tuhs.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: tuhs@tuhs.org X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: C history question: why is signed integer overflow UB? List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Relating this all to a Godel-ish classification of axiomatic systems,=20 language definitions with undefined behavior may be perfectly=20 consistent, but there is useful behavior that cannot be expressed in=20 those languages, while languages with no undefined behavior but with=20 lots of implementation-specific behavior can express much more, but with= =20 less consistency. On 08/15/2025 02:04 PM, Douglas McIlroy wrote: > Idle thought; There's been mention of 1's complement. If overflow is > UB because of that possibility, maybe =3D=3D0 should be, too! > > Doug > > On Fri, Aug 15, 2025 at 2:44=E2=80=AFPM John Levine wr= ote: >> It appears that Luther Johnson said: >>> -=3D-=3D-=3D-=3D-=3D- >>> >>> I hear and understand what you're saying. I think what I'm trying to >>> point out, is that in C, as it was originally implemented, in >>> expressions "a + b", "a >> 1", "++a", C "does what the machine does". >> We just had the same argument in comp.arch and came to largely the same >> conclusion. While overflow behavior on any particular machine may be >> predictable, there's no consistency from one machine to another, >> particularly back when there were still one's complement machines >> where people compiled C code (some of the Univac mainframes.) >> >> It isn't all that predictable even on a single machine. I know several >> where overflow might or might not trap depending on a program-settable >> status bit. >> >> R's, >> John