[TUHS] Maximum Array Sizes in 16 bit C
Henry Bent
henry.r.bent at gmail.com
Thu Sep 19 09:57:06 AEST 2024
On Wed, 18 Sept 2024 at 19:51, Douglas McIlroy <
douglas.mcilroy at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.tuhs.org/pipermail/tuhs/attachments/20240918/8fd17f49/attachment.htm>
More information about the TUHS
mailing list