comp.lang.ada
 help / color / mirror / Atom feed
From: sjw <simon.j.wright@mac.com>
Subject: Re: Record representation : components order
Date: Sun, 5 Jul 2009 03:16:05 -0700 (PDT)
Date: 2009-07-05T03:16:05-07:00	[thread overview]
Message-ID: <055e4e4e-94ec-40fb-b317-4f45a579148a@c9g2000yqm.googlegroups.com> (raw)
In-Reply-To: fe5c021f-bb6a-466f-b5ec-00ceb94661ae@32g2000yqj.googlegroups.com

On Jul 5, 4:14 am, Hibou57 (Yannick Duchêne)
<yannick_duch...@yahoo.fr> 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 “ at range ” 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 := 20;

   TCL_DSTRING_STATIC_SIZE : constant := 200;

   --  Sizes of structs defined in tcl.h.

   Tcl_CallFrame_Size : constant := 44;
   Tcl_CallFrame_Alignment : constant := 4;




  reply	other threads:[~2009-07-05 10:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-04 21:08 Record representation : components order Hibou57 (Yannick Duchêne)
2009-07-05  3:14 ` Hibou57 (Yannick Duchêne)
2009-07-05 10:16   ` sjw [this message]
2009-07-06  7:33     ` Stephen Leake
2009-07-07 19:37       ` sjw
2009-07-09  9:28         ` Stephen Leake
2009-07-09 19:16           ` sjw
2009-07-10  5:26             ` Stephen Leake
2009-07-06  7:29   ` Stephen Leake
2009-07-06  8:07   ` Jean-Pierre Rosen
2009-07-05 14:10 ` Stephen Leake
2009-07-06  2:57   ` Hibou57 (Yannick Duchêne)
2009-07-06  8:27     ` Jacob Sparre Andersen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox