Topic: Installing cfront on MIPS


Author: mel@ascutney.dartmouth.edu (Mel Menezes)
Date: 5 Aug 91 17:15:10 GMT
Raw View
I am trying to install AT&T's c++, cfront, on a MIPS machine running
ULTRIX 4.2 and I
am running into some problems.  I think they indicate that the C
Compiler is not a
proper ANSI implementation, and I hope someeone could help me out...

I have completed the "make fillscratch" part on a VAX machine, and when
tried the
make scratch on the target (MIPS) machine.  The first thing I discovered
was that
the ANSI 'const' qualifier is treated incorrectly.  I got around this by just
eliminating all the const's in the code.  Now I find that I get the following
compilation error when the file y.tab..c (in attc++/scratch/src) is being
===============================================================================
cc -c src/y.tab..c
ccom: Error: ../../src/gram.y, line 337: operands of = have incompatible types
      union YYSTYPE yylval = { 0 } ;
      ---------------------------^
ccom: Error: ../../src/gram.y, line 337: operands of = have incompatible types
      union YYSTYPE yyval = { 0 } ;
      --------------------------^
===============================================================================



YYSTYPE has been declared earlier in the code (line 1213 in y.tab..c) as:
===========================================================
union YYSTYPE { /* sizeof YYSTYPE == 4 */)
char *s__7YYSTYPE ;
TOK t__7YYSTYPE ;
int i__7YYSTYPE ;
struct loc l__7YYSTYPE ;
Pname pn__7YYSTYPE ;
Ptype pt__7YYSTYPE ;
Pexpr pe__7YYSTYPE ;
Pstmt ps__7YYSTYPE ;
Pbase pb__7YYSTYPE ;
Pnlist nl__7YYSTYPE ;
Pslist sl__7YYSTYPE ;
Pelist el__7YYSTYPE ;
Pbcl pbc__7YYSTYPE ;
Pptr pp__7YYSTYPE ;
PP p__7YYSTYPE ;
Plist pl__7YYSTYPE ;
struct toknode *q__7YYSTYPE ;
};
==========================================================


I am not too familiar with the workings of union's in ANSI C, but I have
tried various
ways around the problem, like using the line "union YYSTYPE yylval =
(char *) 0"
instead but have come up with the same or similar errors each time.

If anyone has come across similar problems while installing cfront or in
any related
context and has any suggestions, please post or mail them to me.


-Mel

email: mel@sunapee.dartmouth.edu