shapiro@inria.UUCP (02/17/87)
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 <<cfront 05/20/86>> 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
mikem@otc.UUCP (02/18/87)
In article <396@inria.UUCP>, shapiro@inria.UUCP (Marc Shapiro) writes: > 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 <<cfront 05/20/86>> error: bus error (or > something nasty like that) Strange. I get: $ CC -c +i tst.c CC tst.c: "tst.c", line 10: error: base::base() is protected 1 error $ Sounds like a bug in the port to me. Maybe the vararg stuff in error.c is affecting not only Pyramids (?) (This was the main stuff that we had to rewrite to get cfront up.) > 3) I have a wierd problem with an inline constructor when the derived > class has 2 constructors. This bug is truly amazing. See separate posting. Mike Mowbray Systems Development Overseas Telecommunications Commission (Australia) UUCP: {seismo,mcvax}!otc.oz!mikem ACSnet: mikem@otc.oz