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!c9g2000yqm.googlegroups.com!not-for-mail From: sjw Newsgroups: comp.lang.ada Subject: Re: Record representation : components order Date: Sun, 5 Jul 2009 03:16:05 -0700 (PDT) Organization: http://groups.google.com Message-ID: <055e4e4e-94ec-40fb-b317-4f45a579148a@c9g2000yqm.googlegroups.com> References: <908a786e-214e-436f-868b-c0ead259fcc5@r33g2000yqn.googlegroups.com> NNTP-Posting-Host: 82.20.239.89 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1246788965 10694 127.0.0.1 (5 Jul 2009 10:16:05 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 5 Jul 2009 10:16:05 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c9g2000yqm.googlegroups.com; posting-host=82.20.239.89; posting-account=_RXWmAoAAADQS3ojtLFDmTNJCT0N2R4U User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.18 (KHTML, like Gecko) Version/4.0.1 Safari/530.18,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6839 Date: 2009-07-05T03:16:05-07:00 List-Id: On Jul 5, 4:14=A0am, Hibou57 (Yannick Duch=EAne) wrote: > 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. No good telling the Ada compiler to use a size (or alignment, or ...) that the C compiler only knows because of some #defines that are only visible to the C compilation! For tcladashell, I have a Tcl script which generates a C program which generates an Ada spec (the reason for the Tcl script is that there are at least 3 different kinds of definition required, for several variables. I suppose I could have used C macros ...). Sample output: package Tcl_Record_Sizes is -- Size macros defined in tcl.h. NUM_STATIC_TOKENS : constant :=3D 20; TCL_DSTRING_STATIC_SIZE : constant :=3D 200; -- Sizes of structs defined in tcl.h. Tcl_CallFrame_Size : constant :=3D 44; Tcl_CallFrame_Alignment : constant :=3D 4;