comp.lang.ada
 help / color / mirror / Atom feed
* c2ada and hello world
@ 2013-09-14  0:30 Jerry
  2013-09-14  6:06 ` Shark8
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jerry @ 2013-09-14  0:30 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c2ada and hello world
  2013-09-14  0:30 c2ada and hello world Jerry
@ 2013-09-14  6:06 ` Shark8
  2013-09-14  8:02 ` Simon Wright
  2013-09-19 20:23 ` Per Sandberg
  2 siblings, 0 replies; 4+ messages in thread
From: Shark8 @ 2013-09-14  6:06 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c2ada and hello world
  2013-09-14  0:30 c2ada and hello world Jerry
  2013-09-14  6:06 ` Shark8
@ 2013-09-14  8:02 ` Simon Wright
  2013-09-19 20:23 ` Per Sandberg
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Wright @ 2013-09-14  8:02 UTC (permalink / raw)


Jerry <lanceboyle@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).


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c2ada and hello world
  2013-09-14  0:30 c2ada and hello world Jerry
  2013-09-14  6:06 ` Shark8
  2013-09-14  8:02 ` Simon Wright
@ 2013-09-19 20:23 ` Per Sandberg
  2 siblings, 0 replies; 4+ messages in thread
From: Per Sandberg @ 2013-09-19 20:23 UTC (permalink / raw)


???
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


On Fri, 13 Sep 2013 17:30:54 -0700 (PDT)
Jerry <lanceboyle@qwest.net> wrote:


> 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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-19 20:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-14  0:30 c2ada and hello world Jerry
2013-09-14  6:06 ` Shark8
2013-09-14  8:02 ` Simon Wright
2013-09-19 20:23 ` Per Sandberg

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