The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Henry Bent <henry.r.bent@gmail.com>
To: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: TUHS main list <tuhs@tuhs.org>
Subject: [TUHS] Re: Maximum Array Sizes in 16 bit C
Date: Wed, 18 Sep 2024 19:57:06 -0400	[thread overview]
Message-ID: <CAEdTPBfPcmZybb0CVLxhzB-nLTQb3aohWV-o_8ZqQJXmUc4yPA@mail.gmail.com> (raw)
In-Reply-To: <CAKH6PiWvuxfa_ek=L=n=mgovFk_ms37u6F2N1qcMLs6RXLRWvA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 855 bytes --]

On Wed, 18 Sept 2024 at 19:51, Douglas McIlroy <
douglas.mcilroy@dartmouth.edu> wrote:

> > The array size} limit that I found through trial and error is (2^15)-1.
> > Declaring an array that is [larger] results in an error of "Constant
> required",
>
> On its face, it states that anything bigger cannot be an integer constant,
> which is reasonable because that's the largest (signed) integer value. Does
> that version of C support unsigned constants?
>

I believe that it does support (16 bit) unsigned int, but I don't think
that it supports (32 bit) unsigned long, only signed long.  That's a great
suggestion of a place to start.  Following Nelson's suggestion, if there
need to be negative references in array accesses (which certainly makes
sense to me, on its face), it seems reasonable to have whatever
intermediate variable be signed.

-Henry

[-- Attachment #2: Type: text/html, Size: 1273 bytes --]

  reply	other threads:[~2024-09-18 23:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 23:51 Douglas McIlroy
2024-09-18 23:57 ` Henry Bent [this message]
2024-09-19 13:13   ` Rich Salz
2024-09-20 13:33     ` Paul Winalski
2024-09-20 15:07       ` Dave Horsfall
2024-09-20 15:30         ` Larry McVoy
2024-09-20 15:56         ` Stuff Received
2024-09-20 16:14         ` Dan Cross
2024-09-20 17:11         ` G. Branden Robinson
2024-09-20 20:16           ` Bakul Shah via TUHS
2024-09-20 20:58             ` Warner Losh
2024-09-20 21:18               ` Rob Pike
2024-09-20 22:04               ` Bakul Shah via TUHS
2024-09-20 22:19               ` G. Branden Robinson
2024-09-20 15:26       ` Rich Salz
2024-09-20 19:40     ` Leah Neukirchen
2024-09-20 15:24 Douglas McIlroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEdTPBfPcmZybb0CVLxhzB-nLTQb3aohWV-o_8ZqQJXmUc4yPA@mail.gmail.com \
    --to=henry.r.bent@gmail.com \
    --cc=douglas.mcilroy@dartmouth.edu \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).