C++ on Silicon Graphics workstations

Michael Chmilar chmilar at .ucalgary.ca
Sat Oct 15 06:03:44 AEST 1988


In article <62 at cs-spool.calgary.UUCP>, jevans at .ucalgary.ca (David Jevans) writes:
> In article <294 at unicads.UUCP>, ken at unicads.UUCP (Ken Garnett) writes:
> > Does anybody out there know if there is a version of C++ that works on
> > Silicon Graphics hardware (either the SGI 3000 series, or the 4-D series)??
> 
> We ported the at&t c++ compiler to our iris 3020. no probs.  the thing
> is pretty easily ported to any unix machine.  why not buy a copy and
> port the thing?  it is simply a matter of reading the manual and answering
> some questions as it prompts you (max 1 or 2 days).  once cfront is up it uses
> the c compiler on the iris to generate the executable code.  no reason why it
> should not be simple to port to a 4d.
> 
> Dave Jevans

Dave has omitted one important point.  If you look at the C code that
cfront generates, you will see that it pre- and appends extra characters
onto your variable names.  These names can become very long if a function
name in a class is overloaded.  For example, I have an overloaded matrix
constructor for a 4x4 matrix, and the name generated is something like:

  _matrix__ctor__D_D_D_D_D_D_D_D_D_D_D_D_D_D_D_D

The crappy C compiler that comes with the crappy AT&T Unix only allows
variable names to be 32 characters long (at least the one that we have
does this).  Thus, the compiler blows up, eventually, on code like this.
It doesn't complain about "identifier too long" or anything like that -
it puts some version of the name in the symbol table, and then blows up
when it later tries to match it.  Probably one copy is truncated and the
other isn't.

Since AT&T puts out both C++ and the standard Unix C compiler, you would
expect them to be compatible.  Maybe this has been fixed in a newer
release than what we have - I don't know...I just don't know.



More information about the Comp.sys.sgi mailing list