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!mx02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.unit0.net!cyclone03.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!post01.fr7!fx18.fr7.POSTED!not-for-mail From: Brian Drummond Subject: Re: Newcomers to comp.lang.ada: welcome and how did you end up here ? Newsgroups: comp.lang.ada References: <20141007101042.08f99687@atmarama.ddns.net> <1028866756434371637.714832laguest-archeia.com@nntp.aioe.org> <20141008092318.18ca2ecd@atmarama.ddns.net> User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: NNTP-Posting-Host: 62.49.20.82 X-Complaints-To: abuse@demon.net X-Trace: 1412757356 62.49.20.82 (Wed, 08 Oct 2014 08:35:56 UTC) NNTP-Posting-Date: Wed, 08 Oct 2014 08:35:56 UTC Date: Wed, 08 Oct 2014 08:35:56 GMT X-Received-Body-CRC: 1662819269 X-Received-Bytes: 2592 Xref: news.eternal-september.org comp.lang.ada:22210 Date: 2014-10-08T08:35:56+00:00 List-Id: On Wed, 08 Oct 2014 09:23:18 +0200, Gour wrote: > On Tue, 7 Oct 2014 10:49:10 +0000 (UTC) > Luke A. Guest wrote: > >> Yeah hint taken. It's on the back burner but I do intend to get back to >> it after my new site is going. > > Fine, I hope your site's progress is going well. ;) > > Just curious, in general, how much does '-fdump-ada-spec' help when > generating (thin) C++ bindings? My own gut feel on a couple of projects : it probably does 80-90% of the work, depending on the C/C++ styles involved. One hardware interface library in C (to the Aardvark I2C/SPI USB interface from totalphase.com ) used a lot of macros for defining constants. These were untranslated, appearing as comments in the Ada package (apparently because they were untyped numbers). I copied them into a separate package, "aardvark_constants" alongside the autogenrcated "aardvark_h", uncommented and declared the half dozen or so constants I needed, leaving the rest as comments against future use. It would have been a mistake to do this in the autogenerated file because you couldn't autogenerate it anew... On a C++ project several years ago I found it made a poor job of processing C++ templates - perhaps not surprisingly - and the result needed about 20% rewritten by hand. This may have improved since, but I wouldn't be surprised if there are still problems in there. Incidentally '-fdump-ada-spec-slim' often does a better job rather than polluting your project with the full transitive closure of the C namespace... '-fdump-ada-spec' merely reveals how awful the #include mechanism really can get. -- Brian