From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,233f0e04e488a4a2 X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Size of 0..255 is not 8 bits? Date: 1998/05/15 Message-ID: #1/1 X-Deja-AN: 353630272 Sender: news@inmet.camb.inmet.com (USENET news) References: <355C574F.3BA43583@hso.link.com> X-Nntp-Posting-Host: houdini.camb.inmet.com Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1998-05-15T00:00:00+00:00 List-Id: As was finally pointed out, this is an issue with the stream representation of a subtype (i.e. what S'Read and S'Write do), not a problem with S'Size or with the size of objects. As defined by the RM, S'Base'Size is what matters for S'Read and S'Write, not S'Size. This is probably a mistake, since S'Base'Size is not necessarily portable, nor quite what is wanted. We are currently discussing in the "Ada Rapporteur Group" (ARG) making a language change in this area. One possible change would be to make the stream representation for a scalar type use the smallest number of stream elements per item needed to include the range of the *first* subtype, rather than the *base* subtype of the type. This means that certain values that are within the base range of the type might not be writable with 'Write, but that seems better than the current situation where the stream representation is non-portable, and often non-intuitive. As this example points out, it will be important to decide what happens with signed integer types whose first subtype has no negative values. Probably the representation will be based on the value of S'Size, which in a case like this, is clearly defined to be 8. Presuming the size of a stream element is 8, then a scalar type whose first subtype has 'Size of 8 would use just one stream element per item. In any case, this is all just speculation at this point, because the ARG hasn't agreed on how to resolve this issue, or whether to propose any language change at all. However, this news thread indicates that this problem is important to solve sooner rather than later. -Tucker Taft stt@inmet.com