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,ffdd4d59cbfb4caf X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Ada 95 Numerics questions for the experts Date: 1997/08/27 Message-ID: #1/1 X-Deja-AN: 268650603 References: <3401C14B.480@gsfc.nasa.gov> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-08-27T00:00:00+00:00 List-Id: Jeff says <> Actually DEC Ada 83 handles biased types (the reason we implemented it in GNAT was for DEC Ada 83 conmpatibility). Also, your example is wrong thinking. You cannot (more accurately should not be able to) use a size clause to affect the internal layout of an array. Obviously the default layout for MY_array would be expected to use one byte/element., If you want the packed representation, you must use pragma Pack, and then indeed GNAT will happily pack the 8 elements into 24 bits. The relevant RM quote is RM 13.3(53) 53 A Size clause on a composite subtype should not affect the internal layout of components. GNAT follows this implementation advice. If it were not followed, you can get surprising expensive change of representation conversions happening behind your back as a result of type derivation. It is a continuing problem that, despite similar advice in Ada 83 AI's, some Ada 83 compilers, notably VADS, violate this implementation advice, so oftem we have to tell people to add a pragma Pack.