Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: How compatible are the various C++ implementations? Message-ID: <475@taumet.com> Date: 13 Oct 90 18:27:26 GMT References: <901012.051006.5031@nowhere.uucp> Organization: Taumetric Corporation, San Diego Lines: 26 sking@nowhere.uucp (Steven King) writes: > It was for these same reasons (and cost as well) that I choose a translator >as opposed to a native code compiler. Instead of purchasing seperate C++ >compilers for each target (even assuming they were availible) I have a single >C++ translator running on my host platform (386 unix) that can produce C source >for 8051, v40 (a 80186 sort of), 68k, this here box, or anything else that has >a C compiler for it. I dont have to worry about compatibility at the C++ level >since the C output is the same for each target, one only needs to evaluate the >capabilities of the target C compiler. This seems attractive, but is not as reliable as you make it sound. For non-trivial C++ programs, the C code produced by the translator will not necessarily work on arbitrary target machines. For example, the translator knows the sizes of data types (especially ints and pointers), and generates references which depend on knowing those sizes. If a target uses other sizes, the C code will be wrong. If you use the AT&T cfront translator, you can purchase the source so that you can recompile it for use with different targets. It is, however expensive. In any event, you need still need source for the runtime support code used by the translator so that this code can be compiled for use with the various targets. -- Steve Clamage, TauMetric Corp, steve@taumet.com