Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!seismo!mcvax!inria!shapiro From: shapiro@inria.UUCP Newsgroups: comp.lang.c++ Subject: 3 bugs in cfront 1.1 on Sun-3 Message-ID: <396@inria.UUCP> Date: Mon, 16-Feb-87 19:04:41 EST Article-I.D.: inria.396 Posted: Mon Feb 16 19:04:41 1987 Date-Received: Wed, 18-Feb-87 05:56:50 EST Organization: INRIA, Rocquencourt. France Lines: 86 I have a few problems with our cfront 1.1 ported to Sun-3; I wonder if anybody has any helpful ideas. 1) The following doesn't compile correctly: typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; #if defined(sun)||defined(sm90)||defined(vax) const int MAXINT= 0x7fffffff; const u_int MAXUINT= 0xffffffff; const short MAXSHORT= 0x7fff; const short MAXUSHORT= 0xffff; const char MAXCHAR= 0x7f; const u_char MAXUCHAR= 0xff; #endif MAXINT, MAXSHORT, MAXCHAR and MAXUSHORT are correctly expanded into their values, whereas the generated C output contains: u_int MAXUINT = 0Xffffffff ; u_char MAXUCHAR = 0Xff ; and MAXUINT and MAXUCHAR are not correctly expanded. 2) On the following program, cfront aborts: class base { protected: int field; base () {field = 0;}; }; class derived: base { char fold; derived () {fold = '\0';}; }; CC -F tst.c > tst..c "tst.c", line 10: internal <> error: bus error (or something nasty like that) 3) I have a wierd problem with an inline constructor when the derived class has 2 constructors. Below is the simplest example I have been able to devise which exposes the bug. As you see the program passes CC but the code emitted for the 2nd constructor of the derived class is incorrect. If I comment out either of the 2 lines marked "/* !!!! */", or if I use only one constructor in the derived class, then this code compiles correctly. If you have a patch for this I would much appreciate. typedef unsigned int u_int; class base { protected: base(); }; class derived: public base { public: derived(u_int dataSize); derived(u_int offset, u_int length); }; inline /* !!!! */ base::base () { } derived::derived ( u_int dataSize) { u_int size = dataSize; base* mb = new base() /* !!!! */ ; } derived::derived (u_int offset, u_int length) { } Compilation log: CC -I/users/shapiro -c tstmsg.c CC tstmsg.c: cc -c tstmsg..c -lC "tstmsg.c", line 5: redeclaration of _base__ctor mv: tstmsg..o: Cannot access: No such file or directory