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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.ripco.com!news.glorb.com!feed.news.qwest.net!mpls-nntp-01.inet.qwest.net!nx02.iad01.newshosting.com!newshosting.com!news-out.readnews.com!s09-03.readnews.com!not-for-mail X-Trace: DXC=; g:<@8P=1NZ_P16K_6TlWT[3OhcoN[H0PX44`8^\]>7Z25[I[UfBM:U User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Unchecked_Union record inside an other record - trouble References: <53e52322$0$32389$862e30e2@ngroups.net> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <53e71e5e$0$32527$862e30e2@ngroups.net> NNTP-Posting-Host: 92b13f00.ngroups.net Xref: number.nntp.dca.giganews.com comp.lang.ada:188338 Date: 2014-08-10T09:25:17+02:00 List-Id: Yes of couse -fdump-ada-spec is for GCC-gnat but even if you want to take a small subset I find it more efficent and much less errorprone to start with the generated spec:s and edit the generated code afterwards. (have done this with a fairtly large API: 550 header-files 7500 methods 5500 types and some small ones as well. /per On 08.08.2014 23:23, Jeffrey Carter wrote: > On 08/08/2014 12:21 PM, Per Sandberg wrote: >> You shall not try to write interface code by hand you shall use the >> compiler >> gcc -c -fdump-ada-spec >> see GNAT Users guide. >> >> Since humans makes a heap load of errors and erronous asumptions when >> they try >> to translate the contents of a .h file to an .ads file, the compiler >> does a much >> better job. > > While I agree with you in general, the results of -fdump-ada-spec need > to be manually massaged since it produces non-portable, > compiler-dependent code, such as using Address for C pointers. It may > also be preferable to create a binding by hand if you only want a small > subset of a large header. >