|C++ -> C Per.Heggtveit@fou.telenor.no (Per Olav Heggtveit) (1997-01-09)|
|Re: C++ -> C email@example.com (Arch Robison) (1997-01-12)|
|Re: C++ -> C morris@CAM.ORG (1997-01-12)|
|Re: C++ -> C firstname.lastname@example.org (1997-01-12)|
|Re: C++ -> C email@example.com (James Mansion) (1997-01-14)|
|From:||morris@CAM.ORG (Morris Bernstein)|
|Date:||12 Jan 1997 11:47:26 -0500|
|Organization:||Communications Accessibles Montreal, Quebec Canada|
|Keywords:||C++, C, translator|
Per Olav Heggtveit <Per.Heggtveit@fou.telenor.no> wrote:
>I need to convert C++ code to C code (semi)automaticly.
>Has anyone good or bad experience with a certain compiler/tool
>for doing this?
In general, source to source translation systems have two critical
problems. Such translators usually produce highly unreadable output.
If you want to be able to maintain the translated code afterwards,
just forget it. You're almost certainly going to be better off just
reimplmenting your software.
The second problem is the runtime support. For example, if you wanted
cout << "hello, world" << endl;
into C to run it on another system that has no C++ compiler, a C++ to C
translator would be happy to convert it to a sequence of function
calls, something like this:
(__0oHostreamlsPCc(((struct ostream *)
((char *)"hello, world"))),
Unfortunately, the target system won't have any of the required
library functions. Such runtime support systems usually come with
It would help to know more about your intentions.
>[Is there anything other than cfront? -John]
Yes, the Edison Design Group (http://www.edg.com) produces an
excellent and very carefully crafted C++ front-end package that
includes a C code generator.
Morris Bernstein firstname.lastname@example.org
Return to the
Search the comp.compilers archives again.