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=-1.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,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 75D0D215CB for ; Fri, 20 Sep 2024 19:15:37 +0200 (CEST) Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 4DE32437DA; Sat, 21 Sep 2024 03:15:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuhs.org; s=dkim; t=1726852536; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=+HNr+FgN9oKhuE+VjuSm8SRDGHp5+ZB64kP9uQGpYg0=; b=JsRY/Ro7gwqlHT7MJy5VioQ/bGMnMByMK4OAUqp8cPmukRFm9ocDyk4YD0rfyHrae0mlVy iDAi0xWJsxkupRhY2AWMBaZjSz2J8BRjcpzGg7PZHy1I8U1Znguq1zCqXv+LzOn/bPx2hC EUHeTNQmCfw7FUXzZkv0w4pq2FCl/xE= Received: from mail-43167.protonmail.ch (mail-43167.protonmail.ch [185.70.43.167]) by minnie.tuhs.org (Postfix) with ESMTPS id 29468437D8 for ; Sat, 21 Sep 2024 03:15:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1726852530; x=1727111730; bh=+HNr+FgN9oKhuE+VjuSm8SRDGHp5+ZB64kP9uQGpYg0=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=mS6FrN0zValkeHoJFbzKEKnBFI8X3EbFRi4g5IkOuf9EKI5kmXMwZWviCWMRXe7bl B/339Wk/+X4XxXR3bpgQj+gz8lz+1xgyx0dmaEmthQMQe3TRGog1sSVczIsXNCcAe0 V8O6tRC1At+x2Jx4oxiAQb8gWzz9UpnwQtnKK+RvNbfCsq6WA43t7lDpOpKCCr+lr/ UCmwYHEpkQn+RB3WC0ur04WTZsvnEVIOZGJaiu/A0KFdivF7dXSzpw47gpAqwFlUmJ 3tQRmGD8p9IrAQFnBaU+L9eFF0d1QjwC6xUhgAtGzB+PbsIhLvXG/Kjc7WtRF6R7O8 8qHoZm7wyTB9g== Date: Fri, 20 Sep 2024 17:15:28 +0000 To: COFF Message-ID: In-Reply-To: References: <11d46ab4-b90c-83fe-131a-ee399eebf342@horsfall.org> Feedback-ID: 35591162:user:proton X-Pm-Message-ID: 0f1a616cbb67b54ca36eeb820b56e99ae3df3679 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FXVSZS5MODT7WNBHCA6QYDNBUATGKKOK X-Message-ID-Hash: FXVSZS5MODT7WNBHCA6QYDNBUATGKKOK X-MailFrom: segaloco@protonmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; 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: [COFF] Re: [TUHS] Re: Maximum Array Sizes in 16 bit C List-Id: Computer Old Farts Forum Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: segaloco via COFF Reply-To: segaloco On Friday, September 20th, 2024 at 8:56 AM, Stuff Received wrote: > Moved to COFF. >=20 > On 2024-09-20 11:07, Dave Horsfall wrote (in part): >=20 > > Giggle... In a device driver I wrote for V6, I used the expression > >=20 > > "0123"[n] > >=20 > > and the two programmers whom I thought were better than me had to ask m= e > > what it did... > >=20 > > -- Dave, brought up on PDP-11 Unix[*] > >=20 > > [*] > > I still remember the days of BOS/PICK/etc, and I staked my career on Un= ix. >=20 >=20 > Working on embedded systems, we often used constructs such as a[-4] to > either read or modify stuff on the stack (for that particular > compiler+processor only). >=20 > S. My takeaway on out of bounds array access is you're taking the wheel in you= r own hands WRT the memory characteristics of your application. If you're = using some pointer to the middle of a known memory region (e.g. I/O registe= rs) then you're fine stepping a subscript out of bounds in either direction= . If you're making assumptions about how compiler and linker are goi= ng to map C abstractions into RAM/stack...then you better be prepared for a= compiler author to have a different mapping plan in mind. As John Mashey = put it, paraphrasing, C doesn't require you to agonize over all the details= of the machine, but it also allows you to get at many of those details if = you so choose. - Matt G.