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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Unchecked_Union record inside an other record - trouble Date: Fri, 08 Aug 2014 14:23:08 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <53e52322$0$32389$862e30e2@ngroups.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 8 Aug 2014 21:23:10 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="a0c81a81d1281113b3831cf0c04e791a"; logging-data="14491"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1995fL5wXGOXrCqWIEBvtQ9s+JYzZUZ32A=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 In-Reply-To: <53e52322$0$32389$862e30e2@ngroups.net> Cancel-Lock: sha1:6KE/7PTMO3+SOHYOQKacsOsL7vY= Xref: news.eternal-september.org comp.lang.ada:21586 Date: 2014-08-08T14:23:08-07:00 List-Id: 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. -- Jeff Carter "We call your door-opening request a silly thing." Monty Python & the Holy Grail 17