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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fd173879a595bde X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!news.abs.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Default rep specs for record types - documented?? References: From: Stephen Leake Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:Ww0bGL1NdgObocBK835JT2CrkbI= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 05 Nov 2005 05:34:37 -0500 NNTP-Posting-Host: 66.159.65.1 X-Complaints-To: abuse@toad.net X-Trace: news.abs.net 1131186890 66.159.65.1 (Sat, 05 Nov 2005 05:34:50 EST) NNTP-Posting-Date: Sat, 05 Nov 2005 05:34:50 EST Xref: g2news1.google.com comp.lang.ada:6231 Date: 2005-11-05T05:34:37-05:00 List-Id: Anonymous Coward writes: >>> I'm not looking forward to rep specing records bit for bit simply to >>> enforce the same order of elements that's specified in the operation >>> specs. >> >> If 'operation specs' are defining the hardware you are interfacing >> to, then yes, you need a rep clause for each hardware register. The >> time spent writing those clauses _will_ be repaid later when it >> comes to testing on the hardware; there _will_ be fewer bugs. > > Perhaps, but for interfacing with C operations (which is my case), I > would prefer to simply write "pragma convention (C, my_record)" and be > able to expect the compiler to base the representational spec purely > off the operational spec, just as the C compiler would for a structure > that only has an operational spec. If by 'C', your Ada compiler means your C compiler, this will work. > I should not have to micromanage the bitwise layout of a record to > interface with C code. It puts me at a lower level, and positions me > to make human errors (like writing an incomplete rep spec for a > record), when such errors can be avoided by keeping it high level. Which is why 'convention (C)' is available. > Or maybe better yet, mandate > that pragma convention (C,...) matches representation order to > declaration order to keep the number of pragmas minimal. Hmm. You seem to be saying "convention (C) doesn't work for me". That seems like a bug. Can you post some code that doesn't work? Or have you submitted a bug report? -- -- Stephe