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=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from minnie.tuhs.org (minnie.tuhs.org [50.116.15.146]) by inbox.vuxu.org (Postfix) with ESMTP id 351522EBB5 for ; Mon, 18 Nov 2024 13:46:20 +0100 (CET) Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 4EC1A428DB; Mon, 18 Nov 2024 22:46:15 +1000 (AEST) Received: from mout.perfora.net (mout.perfora.net [74.208.4.196]) by minnie.tuhs.org (Postfix) with ESMTPS id 85A68428DA for ; Mon, 18 Nov 2024 22:46:10 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=makerlisp.com; s=s1-ionos; t=1731933969; x=1732538769; i=luther.johnson@makerlisp.com; bh=O3uvwYKPmVMNtBDeBWV59S5vYrrCADTzBZhEZrVyUBw=; h=X-UI-Sender-Class:Subject:To:References: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=R/avMInedTLiWTW+ezcxMl+qDrNealxvMelc6HUBslLkXSh1MozTtqRdZTIsvkF8 /JA9BKo/XwxLybOuMbYqh3AoVF0izTYvYYaVZFWfUrSCTEVMmxDfcsGgwfPXU2WFK A5FYhCMqsyKew1tfz1LJAnazzpWuZChP2htokBv2AXndXDwEt7D3cK+Pi4rkNkmuH Ai1oru9fN/GlyHuq1xW2TS1e162t0bfqGHHU9GCcSQKhZMPfiJ9DtegA99ZSKf7ak SaB7p0DcHxF3RjqrR/iQOzrMirGuPlfi4HzThu9USxFnA+azmeur0nUM5+lZNrR5F SFLIuT7lTuC4vX0B7A== 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 0Lr0UP-1th6lG2U4p-00hyzr for ; Mon, 18 Nov 2024 13:46:09 +0100 Received: from [192.168.234.136] (mobile-166-170-46-136.mycingular.net [166.170.46.136]) by mlhivps (Postfix) with ESMTPSA id B996C480078 for ; Mon, 18 Nov 2024 12:46:08 +0000 (UTC) To: tuhs@tuhs.org References: <20240930191216.tIpea9lo@steffen%sdaoden.eu> From: Luther Johnson Message-ID: Date: Mon, 18 Nov 2024 05:46:04 -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=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:H6LF3OxruT6Ekk+ori+MnWte8nT+8Y1L485epkHLUVEkQ9Syemu 92tm6Jc1w/xpHNUV+YGPNKYs791XsfG5cX+7Sk0Nf4UoVE5+nmHhK5DykGlpv3mQy+qn51r Yhlr94GRX+KhIgEdW8bCbOfihaCOC/dU2nD3zpgISnsJmwOa6mo40qdAi5K4qqxnNcWc11w tLptNv8Wm120PblCEZxvg== UI-OutboundReport: notjunk:1;M01:P0:xWKOoZT5V3c=;9SnekejzK2rLDw22OZPIyEKT6W1 Y6Y4PGhQlgp373Af97YFAGYWokKdkfOCZtjuWQCUu01plm59Z3eeVWS2KyffH+LGOfk7yVrSx PBuNe24TOgFG9Tpv3m60j9Invdcb+6wukQBsiWz1pNOYD90xQi1vKB9X5sgP2lqMGi2+aJXX8 5i6gFWIkRtbPBJAr5+Il5Uk1jrE9Q0RHQJCCTpBBpsLMc2USGymdEAEknb2UETEMeRu3gAVwH t14cCjUNC0ewRUm64P0/S5Ik2t17R1P4kFlVn8SIWHVGRissKsrpIce65D9gcKZp3g5hqjxcl s9qDXXWkGbeOeW5bHTdmKGB9q2jjNjpsj8VEHhgAyf/g8+TLKmToX/iVrAqw1D0qWo18C+FDT CpSQSxJETpHyEODy4sHq1qIMm7akza8GsBn2XpJAK3fuXAKHW8jCEYcTnaWOkYoYf6N51eb9V xBxY+Bm9baIktqnQqzEpcLZlabQruNjqfrCYi0wV679TyBZcFt5N/4pBM8wBVh++5g14gMGUr YCNX9Ub4HH724ClHXOa5vCyAL0W67xw4KsYg7SfwhHiHVyPTaKgjoJg5pBx06c/HN3NXkG0rN GHDNqZKe5DDD0+vDXgtY6yyNZPvvKHj2+ZQlKrOGgeoLyY55yj2oH2iMyhruWnDXRpAz9bZqf U6tmu4jAbOGRm7yWfcF+SI91qmNYjXX8o0Oq2vq54V8BneoMsnd1R9YrTczp2+o0ql+rPFGoD +LiyJ2pqtARKdIQm6mXaoAuq8K8Y4xK4LnxAI6AgTsdhNriPtcVEML3L3Z1fBKYIyF17rNZx4 YtSaHSU8pSTMI2olBzuT/kzDCrXEzDtI5s0GM2rVAYK0A8j2m5LnI2PaStfPUeAPGr Message-ID-Hash: W6VT777YTURSCVQZWEJB4CACNNBV7ONA X-Message-ID-Hash: W6VT777YTURSCVQZWEJB4CACNNBV7ONA 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 X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: Minimum Array Sizes in 16 bit C (was Maximum) List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: C, Lisp, and probably many other languages have gone through a similar historical arc - first they are designed to solve problems, and be a useful and powerful means of expression - then they become official, standardized, and legalistic - then they become commercially competitive, and leverage the legalisms, benchmarks, and other collateral that has accrued - at this point, generations later, the language is evolving with no appreciation or understanding of the aesthetic and practical principles of the original language effort. My old-man-grousing for today. On 11/18/2024 05:00 AM, Anton Shepelev wrote: > Dan Cross wrote: > >> Programmer ability is certainly an issue, but I would suggest that >> another goes back to what Rob was alluding to: compiler writers have >> taken too much advantage of UB, making it difficult to write >> well-formed programs that last. > Following the letter, rather than the spirit, of the standard? > >> The `realloc` function I mentioned earlier is a good case in point; >> the first ANSI C standard says this: "If ptr is a null pointer, the >> realloc function behaves like the malloc function for the specified >> size. ... If size is zero and ptr is not a null pointer, the object it >> points to is freed." While the description of `malloc` doesn't say >> thing about what happens when `size` is 0, perhaps making `realloc(0, >> NULL)` nominally UB (??), the behavior of `realloc(0, ptr)` is clearly >> well defined when `ptr` is not nil, and it's entirely possible that >> programs were written with that well-defined behavior as an >> assumption. (Worth mentioning is that this language was changed in >> C99, and implementations started differing from there.) >> >> But now, C23 has made `realloc(0, ptr)` UB, regardless of the value of >> `ptr` > Something similar happened with so-called strict aliasing, when the > compilers started assuming pointers to incompatible types as always > pointer to different non-overlapping locations: > > See, e.g.: > Linus ranterd about it: > >> My sense is that tossing in bad programmers is just throwing gasoline >> onto a dumpster fire. Particularly when they look to charlatans like >> Robert Martin or Allen Holub as sources of education and inspiration >> instead of seeking out proper sources of education. > I am a bad one as well, to have liked some things in Martin's books > /Clean Code/ and /Clean Architecture/ . True, heis no Wirth, nor > Dijxtra, nor Knuth, but why a charlatan? > >