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=-0.5 required=5.0 tests=BAYES_05 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,54a7591bed8148f2 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news1.google.com!news.glorb.com!wn14feed!worldnet.att.net!attbi_s52.POSTED!53ab2750!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Record representation References: <40c7407c$1_1@baen1673807.greenlnk.net> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 24.6.132.82 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s52 1086803047 24.6.132.82 (Wed, 09 Jun 2004 17:44:07 GMT) NNTP-Posting-Date: Wed, 09 Jun 2004 17:44:07 GMT Organization: Comcast Online Date: Wed, 09 Jun 2004 17:44:08 GMT Xref: g2news1.google.com comp.lang.ada:1328 Date: 2004-06-09T17:44:08+00:00 List-Id: >> type A is record >> type AA is array (Index) of A; >> for AA'Size use A'Size * Index'Last; -- Not allowed!!!!! >Ok, the example was too simple - imagine a record with components that >are arrays, other record etc. You shouldn't be trying to specify a particular size: you may get it wrong (perhaps due to later changes, such as here if Index'First /= 1) and especially since the compiler may not be capable of generating code to do it (the A'size=31 previously mentioned). Pragmas Pack and Component_Size ought to be able to get the compiler to generate any code it is capable of, in particular to make AA take as little storage as possible. ------------------ original American ideology: "War is in fact the true nurse of executive aggrandizement. In war a physical force is created, and it is the executive will to direct it. In war the public treasuries are to be unlocked, and it is the executive hand which is to dispense them, In war the honors and emoluments of office are to be multiplied and it is the executive patronage under which they are to be employed. It is in war finally that laurels are to be gathered, and it is the executive brow they are to encircle. The strongest passions and the most dangerous weakness of the human breast - ambition, avarice, vanity, the honorable or venial love of fame - are all in conspiracy against the desire and duty of peace." James Madison