Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ll-xn!cit-vax!oddhack!jon From: jon@oddhack.Caltech.Edu (Jon Leech) Newsgroups: comp.lang.c++ Subject: Re: C++ version 1.1 on Suns Message-ID: <1212@cit-vax.Caltech.Edu> Date: Thu, 20-Nov-86 01:13:04 EST Article-I.D.: cit-vax.1212 Posted: Thu Nov 20 01:13:04 1986 Date-Received: Thu, 20-Nov-86 03:11:35 EST References: <256@unc.unc.UUCP> Sender: news@cit-vax.Caltech.Edu Reply-To: jon@cit-vax.UUCP (Jon Leech) Distribution: net Organization: California Institute of Technology Lines: 74 Keywords: C++, Release 1.1 In article <256@unc.unc.UUCP> menges@unc.UUCP (John Menges) writes: >11. Ran 'make' in the main directory, with the following result: > ... >CC -O -DBSD -I../complex -c ../complex/abs.c >CC ../complex/abs.c: >"/usr/include/CC/math.h", line 7: internal <> error: 470768-> base type::dcl_print( 102) >1 error Me too. Try editing and moving the declarations of 'atof' and 'frexp' onto two separate lines as follows: /* @(#) math.h 1.4 1/27/86 17:46:49 */ /*ident "@(#)cfront:incl/math.h 1.4"*/ #ifndef _POLY9 extern int errno, signgam; extern int abs (int); extern double atof(const char*); extern double frexp(double, int*); ...etc I don't know why this works, but it does. There are a few other things I had to do: - define MAXFLOAT in - remove the 'Task' target from lib/mk/makefile - add the '-P' option to the CC shell script variable $CPLUS (preprocessor options): CPLUS="-Dc_plusplus=1 -P" for some reason cpp was generating files containing lines like # 1 "file.h" 1 (note the extra trailing line number), which made BOTH cfront and cc complain. The -P cpp option removes line directives, which will have bad implications for debugging, but at least the code compiles now. - contains a line extern int acct (const har *); make the obvious change to 'char *'. - includes , which comes from /usr/include/sys because there is none in /usr/include/CC/sys. A conflicting prototype for signal() results. Fixed by copying the C to the CC version and correcting the signal() prototype. - Finally, in a number of places in src/main.c, and in lib/new/_vec.c:_vec_delete(), the code calls a pointer-to-function without dreferencing it. This works on PCC based compilers but not on Amdahl UTS (this is not a Sun problem). I don't know whether this usage is 'legal' now, but it ought to be fixed to dereference the function pointer in any case. There were a few other minor things while getting C++ up on various systems; if I have time (unlikely soon), I'll try to post a summary similar to the one I did for Release 1.0 last spring. The stuff above covers most of the problems. I ``fortunately'' have access to quite a wide range of machines - Sun, 4.[23] BSD Vax, 3B20, IBM 4381/UTS, HP 9000/320, ELXSI and so get to find all sorts of obscure problems when porting C++ around. -- Jon Leech (jon@csvax.caltech.edu || ...seismo!cit-vax!jon) Caltech Computer Science Graphics Group __@/