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: a07f3367d7,5a3e508f74e87110 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Record representation : components order References: <908a786e-214e-436f-868b-c0ead259fcc5@r33g2000yqn.googlegroups.com> From: Stephen Leake Date: Mon, 06 Jul 2009 03:29:08 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:p68Ic30khvqQyAJrqGLQrESXWlE= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 6d01f4a51a7c4e9cadf9d13451 Xref: g2news2.google.com comp.lang.ada:6851 Date: 2009-07-06T03:29:08-04:00 List-Id: "Hibou57 (Yannick Duchêne)" writes: > Well, I've found an answer, buit this still leave me with a doubt. The > answer first, and the doubt next. > > An Ada-Auth discussion with a guy who has forgotten to apply pragma > Convention (C, ...) to the type of the member of a record (not exactly > the subject, while interesting), ends with these words : > > http://www.ada-auth.org/cgi-bin/cvsweb.cgi/acs/ac-00023.txt?rev=1.1 > says (at the end): >> Now when laying out type Time_Type, it uses textual order for >> the components (this is required by convention C). > > “ required by convention C ” : this is what one would expect indeed, > as I did, without beeing sure. But is it stated in the RM ? Annex B.1 > does not say such a thing. With the guy (the one who opended the > thread), I agree than some more extensive wording would be required to > fullfill the wish that it is possible to do things in Ada without > relying on a particular compiler's behaviour. That's what record representation clauses are for. > Perhaps it is informally clear to someone, so that is has been left > from the standard (when a thing is obvious to someone, it is easy to > forget to point it). No, the meaning of "convention C" is deliberately left implementation defined, so that any given Ada compiler vendor can match any given C compiler. > N.B. pragma Convention is required when the C specs make use of some > type whose size depends on some configuration. This is not convenient > to use “ at range ” in this case. This is the reason of this thread. Can you elaborate? I don't understand why you can't use a record representation clause. Hmm. Perhaps you have a C compiler that allows you to specify the size of "int" or some other C type via a command line switch or some other mechanism. To accomodate that in Ada, you'd need to use different files, selected by a build switch. It's not the same mechanism, but it's not very hard, either. -- -- Stephe