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,FREEMAIL_FROM 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,CP1252 Path: g2news2.google.com!postnews.google.com!32g2000yqj.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Record representation : components order Date: Sat, 4 Jul 2009 20:14:28 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <908a786e-214e-436f-868b-c0ead259fcc5@r33g2000yqn.googlegroups.com> NNTP-Posting-Host: 86.66.190.37 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1246763668 23657 127.0.0.1 (5 Jul 2009 03:14:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 5 Jul 2009 03:14:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 32g2000yqj.googlegroups.com; posting-host=86.66.190.37; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6837 Date: 2009-07-04T20:14:28-07:00 List-Id: 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=3D1.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). =93 required by convention C =94 : 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. 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). An other document now, from AdaPower (for a change): http://www.adapower.com/index.php?Command=3DClass&ClassID=3DAdvanced&CID=3D= 228 says (at the opening): > pragma Convention(Convention =3D> C) (Christopher Green) > > What exactly does "pragma Convention(Convention =3D> C)" do when > applied to a record type? > > It means that record types will be laid out the way C expects them > to be, whatever that is. > > C preserves the order of members within a struct and inserts padding > so that members will be aligned on the machine-dependent proper > address boundary for their type. =93 C preserves the order of members within a struct =94, yes that's true, C do that, but no where a document state what exactly the pragma Convention for a specific language means independently of a particular compiler. Finally, perhaps an annex document would help peoples to feel relieved This will benefit from beeing more officialy formalized. Putting it in the core standard wording may be too much, but in an annex, this would be ok. What are peoples here think about it ? 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 =93 at range =94 in this case. This is the reason of this thread.