Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

c2ada and hello world

149 views
Skip to first unread message

Jerry

unread,
Sep 13, 2013, 8:30:54 PM9/13/13
to
When I try to get c2ada to convert a hello world, all I get is an empty package body and spec, like this:


with C;
with C.Ops; use C.Ops;

package body Users.me.hello is


end Users.me.hello;

and

package Users.me.hello is


end Users.me.hello;


What am I doing wrong?
Jerry

Shark8

unread,
Sep 14, 2013, 2:06:38 AM9/14/13
to
On Friday, September 13, 2013 6:30:54 PM UTC-6, Jerry wrote:
> When I try to get c2ada to convert a hello world, all I get is an empty package body and spec
>
>
> What am I doing wrong?

Using C? ;)


But on a serious note it looks like the output is the translation of an empty header/main. Check to ensure that it's reading in the correct file (does it need fully-qualified path?). Also, you might want to look into the documentation regarding any flags you need to use. -- I've never had to use c2ada so can't really help other than these general tips.

Simon Wright

unread,
Sep 14, 2013, 4:02:17 AM9/14/13
to
Jerry <lance...@qwest.net> writes:

> What am I doing wrong?

I could say (as the last maintainer who did anything much), using c2ada
:-(

It started out as an equivalent of gcc -fdump-ada-spec for headers, and
then someone had the bright idea of getting it to translate .c files as
well; we have no revision history or documentation for this, all we have
is what you see in the SF repo.

It doesn't do too bad a job of headers (though including stdio.h will
generate a lot of output, including here package Sys._Types).

Per Sandberg

unread,
Sep 19, 2013, 4:23:12 PM9/19/13
to
???
When mixing C(++) and Ada nowadays the way to do it is:
* Get the .h(h) files in order and clean.
* Compile a .c(pp) file only containing the required includes with the
switch "-fdump-ada-spec".
This will produce fairly decent specs (.ads-files) given that the
header-files are decent.

So skip c2ada and use the interfaces produced by a modern gcc.

/Per
0 new messages