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_00,TO_NO_BRKTS_PCNT, XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dd6622a305422ade,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-08 21:38:07 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!sjc1.nntp.concentric.net!newsfeed.concentric.net!newsfeed.ozemail.com.au!ozemail.com.au!not-for-mail From: "Chris Miller" Newsgroups: comp.lang.ada Subject: Suggestion for Ada 0X - "Complete" Record Rep Clauses X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Message-ID: NNTP-Posting-Host: 2cust29.tnt11.syd2.da.uu.net X-Trace: ozemail.com.au 1000010265 63.60.242.29 (Sun, 09 Sep 2001 14:37:45 EST) NNTP-Posting-Date: Sun, 09 Sep 2001 14:37:45 EST Organization: OzEmail Ltd, Australia Distribution: world Date: Sun, 9 Sep 2001 11:08:40 +1000 Xref: archiver1.google.com comp.lang.ada:12938 Date: 2001-09-09T11:08:40+10:00 List-Id: Here is a quick suggestion for Ada 0X. I have no idea if it has been suggested before. Record representation clauses (LRM13.5.1) allow the locations for the components of a record to be specified, but there is no way to ensure that the location for each and every field is specified. If you do not specify the location for a component then the compiler can put it anywhere. This is generally not what is wanted, if a rep clause is used then typically the location of all fields will need to be specified. Assume you have type R is record field1 : typea; field2 : typeb; field3 : typec; end record; for R use record field1 at 0 range ...; field3 at 3 range ...; end record; This is probably an error, since the location for field2 has been left out. In this example it is blatantly obvious, however in real world code (for example the layout of bus messages) there can be many fields and it is easy to leave one out. This can lead to hard to find errors. The addition could be to allow an optional reserved work "all" in the record rep clause, in this case it would be a compile time error if the component clauses for all fields were not specified. So you would get for R use all record field1 at 0 range ...; field2 at 3 range ...; field3 at 7 range ...; end record; This would be trivial to implement, and 100% upward compatible with current code. May also wish to have a pragma that specifies that all record rep clauses in its scope are complete. This could be either a new pragma or part of pragma Restrictions, in the Safety & Security Annex. Comments ?? Chris Miller chrismil at ozemail dot com dot au 9 Sept 2001.