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,1b043921d2cf45d2 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!newspump.monmouth.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Interfacing to C without dynamic memory Date: Fri, 14 Nov 2008 18:13:59 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <8a0e9a41-6670-486b-bbb7-7ef706643930@a17g2000prm.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1226704439 29432 192.74.137.71 (14 Nov 2008 23:13:59 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 14 Nov 2008 23:13:59 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:mdD7HY1OA3+Yock0dBIk/29EYFM= X-Original-Bytes: 1397 Xref: g2news2.google.com comp.lang.ada:8408 Date: 2008-11-14T18:13:59-05:00 List-Id: Maciej Sobczak writes: > My first ideas are: > 1. Extract sizeof(T) at C level. > 2. In Ada, create appropriately aligned: > > type T is System.Storage_Array (1 .. Size_Of_T); > for T'Alignment use Appropriate_Alignment_Value; Makes sense. You could write a C program that #include's the relevant .h file, and prints out an Ada package spec containing the above Ada code. You could run this as part of your build scripts. - Bob