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,c76d41708bf94f23 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news3.google.com!feeder.news-service.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: c2ada bug report filed Date: Mon, 04 Apr 2011 18:27:44 +0100 Organization: A noiseless patient Spider Message-ID: References: <3a657bf9-89ed-45c8-bd4d-f226cb3bc5fa@w7g2000pre.googlegroups.com> <61c5b143-0617-4fc9-a395-14bb8530cc96@k10g2000prh.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="10114"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18HfYnC11WyKzQnIB5D/J/Lx/NpCAf4OL8=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:dll2mQpVdyT/VzXpgfwbPGjsLyw= sha1:Eo0GQSLNHA6Iuzzz61M7F6akMmI= Xref: g2news2.google.com comp.lang.ada:19658 Date: 2011-04-04T18:27:44+01:00 List-Id: Jerry writes: > I don't expect much handholding here but I thought that I should at > least report my results. Thanks. I have to admit I joined the C2Ada project because it seemed it might come in handy, and I really like things to be done portably if at all possible. I'm far from an expert in the package. I suspect you'd need to add some project-specific tweaks for a particular project. Certainly "c2ada /usr/include/tcl.h" on its own doesn't produce anything remotely useful; I'm not sure what Terry Westley did to get it to provide the initial translation for Tcl/TK in TASH. > I updated my system to OS X 10.6.7 and Xcode to 3.2.6. > > After downloading c2ada from SVN, rev 23, I cd-ed to the distribution > directory and built by ./setup and make which created c2ada. I then > ran c2ada (still cd-ed to the distribution dir) on two very small C > programs in another directory. The first one > > int main(void) > { > int a; > a = 1; > return 0; > } > > resulted in a useful Ada package. However, the second one > > #include > int main(void) > { > printf("Hello World\n"); > return 0; > } > > resulted in just a skeleton Ada package with no useful lines. (Other > files were also created.) The terminal output had a few lines that > looked troublesome. I tried with -I/usr/include which is where stdio.h > is stored but it made no difference in the output, at least with > respect to the corresponding Ada package. As the web page http://c2ada.sourceforge.net/c2ada.html says, Using C2Ada is a way to lessen the work in translating C headers into Ada, to produce a binding, and in translating whole C programs into Ada, producing a translation. C2Ada can do about 80% to 90% of the work automatically but it still takes some manual work to do the last 10% or 20%. The technology for translating C headers is more mature than the technology for translating C functions and statments. C2Ada does not translate C++, just C. Personally I always thought that it was a mistake to take on the translation of C body files (IYSWIM). I suppose one could make some simple translations for printf(), but it's not really Ada-compatible.