C++ to C

B

Bootstrap Bill

Are there any open source C++ compilers that will produce C code? I
understand the first C++ compilers operated this way.
 
F

Frank Schmitt

Bootstrap Bill said:
Are there any open source C++ compilers that will produce C code? I
understand the first C++ compilers operated this way.

You might want to have a look at Comeau - it's not open source, but
it's cheap, and AFAIK does exactly what you want
(www.comeaucomputing.com)

HTH & kind regards
frank
 
T

those who know me have no need of my name

in comp.lang.c i read:
You might want to have a look at Comeau - it's not open source, but
it's cheap, and AFAIK does exactly what you want

but note that the code produced isn't intended for human consumption or
later use, so it's not necessarily maintainable (at least not directly).
 
D

Dan Pop

In said:
in comp.lang.c i read:

but note that the code produced isn't intended for human consumption or
later use, so it's not necessarily maintainable (at least not directly).

And it's not portable C code, either. It's code fit for the target C
implementation(s) only.

Dan
 
G

Greg Comeau

You might want to have a look at Comeau - it's not open source, but
it's cheap, and AFAIK does exactly what you want
(www.comeaucomputing.com)

Well, Comeau C++ does produce C as an implementation detail.
But that's not supposed to be a user concerns per se,
so Bootstrap should probably elaborate upon his needs,
and we can re-advise him from there. In other words,
what it the underlying need for the request in the first place?
 
S

Sheldon Simms

Well, Comeau C++ does produce C as an implementation detail.
But that's not supposed to be a user concerns per se,
so Bootstrap should probably elaborate upon his needs,
and we can re-advise him from there. In other words,
what it the underlying need for the request in the first place?

The OP was also asking for C compiliers for the 6809,
so I suspect he is looking for a why to compile C++
code for one or more platforms for which no C++ compiler
exists.

-Sheldon
 
D

Dan Pop

In said:
The OP was also asking for C compiliers for the 6809,
so I suspect he is looking for a why to compile C++
code for one or more platforms for which no C++ compiler
exists.

Then, he is wasting his time. Apart from the portability of the generated
C code issue, there is also the missing C++ library support issue.

Dan
 
B

Bootstrap Bill

Sheldon Simms said:
The OP was also asking for C compiliers for the 6809,
so I suspect he is looking for a why to compile C++
code for one or more platforms for which no C++ compiler
exists.
Yes, that is exactly what I want to do..
 
E

E. Robert Tisdale

Bootstrap said:
I asked about converting to C, so this is on topic.

Please ignore Jack Klein. He gets cranky sometimes.
And is often short tempered with new subscribers.
But, when he feels like it, he can be one of the best contributors
to the comp.lang.c newsgroup. Just be patient.
 
E

E. Robert Tisdale

Bootstrap said:
Are there any open source C++ compilers that will produce C code?
No.

I understand the first C++ compilers operated this way.

You probably mean AT+T's cfront.

I used Google

http://www.google.com/

to search for

+"C++" +"cfront" +"back end"

and I found lots of stuff including
The C++ Front End

http://www.edg.com/cpp.html

I don't know whether any of these are "open source"
or whether any of them *emit* portable C code.
 
M

Mark McIntyre

I asked about converting to C, so this is on topic.

Not really. In CLC. the topic here is the C /language/ rather than
specific implementations of it. And converting one language to another
is certainly nontopical.

ISTR that you wanted an implementation for a PIC of some sort -
comp.arch.embedded might be a better place to ask.
 
M

Micah Cowan

E. Robert Tisdale said:
Please ignore Jack Klein.

That would be unwise.
He gets cranky sometimes.

Whether he was cranky or not I cannot determine, but he was
completely correct in pointing out that the question is
off-topic. We discuss *only* the C programming language here, not
tools to convert C++ to C code, not tools to edit C code; not
even tools to compile C code. Only the language itself is topical
here (besides the universally topical topic of topicality... such
as this message ;-) ) It is similarly off-topic in comp.lang.c++
as well.
And is often short tempered with new subscribers.
But, when he feels like it, he can be one of the best contributors
to the comp.lang.c newsgroup. Just be patient.

You speak as one who has the authority to determine who is a good
contributor to these newsgroups, whereas so far you do not.
 
R

Richard Heathfield

Default said:
Listen to Jack Klein.

Indeed. In case anyone's been spending the last few years under a stone on
Mars, Jack Klein is one of the most clueful respondents on clc (can't speak
for clc++, but it wouldn't surprise me at all if he were highly respected
there, too).
 
J

John Smith

E. Robert Tisdale said:
Please ignore Jack Klein. He gets cranky sometimes.
And is often short tempered with new subscribers.
But, when he feels like it, he can be one of the best contributors
to the comp.lang.c newsgroup. Just be patient.

ROTFL :)! Sometimes this NG is better than "Seinfeld."
 
G

glen herrmannsfeldt

Mark McIntyre wrote:

(snip)
Not really. In CLC. the topic here is the C /language/ rather than
specific implementations of it. And converting one language to another
is certainly nontopical.

Converting one language to another is pretty questionable, but then what
group should it go under?

If this group only discussed the C language then it would be pretty
dull. Discussing whether or not some construct is allowed, I would
hope, would be on topic. Since it is not the C /language/ until that is
decided, then you wouldn't know if you could discuss it otherwise.

I would say that discussing a particular compiler's ability to compile
the C language could also be on topic, though the general subject of
compilers would not be. In a similar sense the ability, or inability,
of a translator to translate from or to standard C could be on topic,
though it would depend on the specific question.
ISTR that you wanted an implementation for a PIC of some sort -
comp.arch.embedded might be a better place to ask.

In years past, the 6809 was considered a general purpose processor,
though now it may be more for the embedded market. The first C compiler
I owned was for the 6809, though.

It might be that this question is better for comp.lang.c++, which I
carefully snipped from this reply.

-- glen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,104
Messages
2,570,643
Members
47,247
Latest member
youngcoin

Latest Threads

Top