Re: [cc65] Converting the cc65 sources to C++

Date view Thread view Subject view

From: Marko Mäkelä (msmakela_at_cc.hut.fi)
Date: 1999-09-13 18:17:09


On Mon, 13 Sep 1999, MagerValp wrote:

> A C++ to C translator wouldn't be impossible, would it?

For the current version of C++ (ISO/IEC 14882:1998) it is quite difficult.  
Things like name spaces and member templates.  Well, both can probably be
addressed by writing a good name-mangling function, but then the C
compiler would have to accept identifiers that are long enough (up to a
few kilobytes in the worst case).

> IIRC this is how the early C++ compilers worked.

Yep, and there are some not so old C++ compilers that are based on cfront.

> Anything radically different in the backend-department?

There's a Java bytecode backend, but I haven't had a look on the backends.

> I looked at the 6809 backend for gcc 2.7.2, and it looked like an
> awful lot of work.

Like emulating a 32-bit processor using pseudo-registers in the zero page
(or direct page), yes.  I'm not aware of any 6502 backend for gcc (or
maybe there were some plans/early work in the Oric community a couple of
years ago).

BTW, does cc65 compile tricks like

int main(){return printf("hello world\n"), 0; }

properly?  In other words, is it strictly based on the C grammar, or is
the parser mainly ad-hoc code?

	Marko

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:44 CET