comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: c2ada bug report filed
Date: Mon, 04 Apr 2011 18:27:44 +0100
Date: 2011-04-04T18:27:44+01:00	[thread overview]
Message-ID: <m2aag6udtb.fsf@pushface.org> (raw)
In-Reply-To: 61c5b143-0617-4fc9-a395-14bb8530cc96@k10g2000prh.googlegroups.com

Jerry <lanceboyle@qwest.net> 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 <stdio.h>
> 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.



  reply	other threads:[~2011-04-04 17:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30  8:15 c2ada bug report filed Jerry
2011-03-30 14:15 ` Simon Wright
2011-03-30 20:03   ` Simon Wright
2011-04-02  4:45     ` Jerry
2011-04-04 17:27       ` Simon Wright [this message]
2011-04-04 23:46         ` Jerry
2011-03-31 18:01 ` Per Sandberg
2011-03-31 21:03   ` Simon Wright
2011-04-01  1:07     ` Randy Brukardt
2011-04-01  6:38       ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox