Path: utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!WUCS1.WUSTL.EDU!vjg From: vjg@WUCS1.WUSTL.EDU (Victor J. Griswold) Newsgroups: gnu.g++.bug Subject: (none) Message-ID: <8904141503.AA28252@wucs1.wustl.edu> Date: 14 Apr 89 15:03:23 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 407 Mr. Tiemann: We have experienced three problems with GNU C++ 1.34.2, used with GNU C 1.34.0. Our copy of C++ has had all non-sparc patches applied. Our environment is a network of sun3's running off one sun3 file server. The file server has a 68881, some of the workstations do not, therefore the compilers are compiled for use in a non-68881 environment. We are running sun OS 3.4 (yes, not 3.5). All tests were run on the file server. The first problem, of which you are probably already aware, concerns sun3 configuration: Fcrt1, Wcrt1, and Mcrt1 are not found. This problem has already been mentioned by Doug Schmidt in his 9 Mar 89 news posting to gnu.g++.bug (put /lib/ in front of them in tm-sun3.h), but this fix has not yet been incorporated into g++ proper. The second problem concerns compilation of libg++-1.34.0. The HINTS file implies that FASCIST_ASSEMBLER will not be necessary for sun as, though it was quite necessary for proper compilation of builtin.cc. Other problems with the library are being reported to dl@rocky.oswego.edu. The third problem concerns default constructors for nested structures. Given a struct S1 with default constructor S1::S1, a struct S2 containing an field of type S1, and a struct A1 containing an array of type S2, compilation fails with "unexpected argument to constructor A1" (logged below). AT+T C++ handles this construct correctly. When explicit reference to the S1::S1 constructor is made in the S2 and A1 constructors, g++ handles this construct correctly, also (but explicit reference should not be necessary). Below are compilation logs of 'ctor_test1.C', showing the compilation error, and of 'ctor_test.C', showing the workaround. By the way, AT+T C++ fails with "sorry, not implemented" on the workaround. Thank you for a fine product, already substantially more useful than cfront 1.2. Victor Jon Griswold Computer and Communications Research Center vjg@wucs1.wustl.edu ------------------------------------------------------------------------------ dworkin:/usr4/src/GNU/cmtest/CM >g++ -E ctor_test1.C # 1 "ctor_test1.C" # 1 "/usr/new/include/CC/stdio.h" extern struct _iobuf { int _cnt; unsigned char *_ptr; char *_base; int _bufsiz; short _flag; char _file; } _iob[20 ]; extern int _flsbuf(unsigned,struct _iobuf *); extern int _filbuf(struct _iobuf *); extern struct _iobuf * fopen(const char*, const char*); extern struct _iobuf * fdopen(int, const char*); extern struct _iobuf * freopen(const char*, const char*, struct _iobuf *); extern long ftell(const struct _iobuf *); extern char* fgets(char*, int, struct _iobuf *); extern char* gets(char*); extern int puts(const char*); extern int fputs(const char*, struct _iobuf *); extern int printf(const char* ...); extern int fprintf(struct _iobuf *, const char* ...); extern int sprintf(char*, const char* ...); extern int scanf(const char* ...); extern int fscanf(struct _iobuf *, const char* ...); extern int sscanf(char*, const char* ...); extern int fread(char*, unsigned int, int, struct _iobuf *); extern int fwrite(const char*, unsigned int, int, struct _iobuf *); extern int fclose(struct _iobuf *); extern int fflush(struct _iobuf *); extern void clearerr(struct _iobuf *); extern int fseek(struct _iobuf *, long, int); extern void rewind(struct _iobuf *); extern int getw(struct _iobuf *); extern int fgetc(struct _iobuf *); extern struct _iobuf * popen(const char*, const char*); extern int pclose(struct _iobuf *); extern int putw(int, struct _iobuf *); extern int fputc(int, struct _iobuf *); extern void setbuf(struct _iobuf *, char*); extern int ungetc(int, struct _iobuf *); extern void exit(int); extern int abort(...); extern int atoi(const char*); extern double atof(const char*); extern long atol(const char*); extern struct _iobuf *tmpfile (); extern char *ctermid(char*), *cuserid(char*), *tempnam(char*, char*), *tmpnam(char*); extern void perror (const char*); extern int errno; extern char* sys_errlist[]; extern int sys_nerr; extern unsigned char *_bufendtab[]; # 140 "/usr/new/include/CC/stdio.h" # 1 "ctor_test1.C" struct base_type { int base_field; base_type(int ini_base_field = 17); }; base_type::base_type(int ini_base_field) { base_field = ini_base_field; } struct derived_type { base_type base; }; struct array_type { derived_type derived[10]; }; void main() { array_type a; int x; for(x = 0; x < 10; x++) printf("a.derived[%d].base.base_fild = %d\n",x,a.derived[x].base.base_field); } dworkin:/usr4/src/GNU/cmtest/CM >g++ -o ctor_test1 ctor_test1.C /usr/new/include/CC/stdio.h:98: warning: lazy prototyping frowned upon In function void main (): ctor_test1.C:29: invalid use of non-lvalue array ctor_test1.C:29: unexpected argument to constructor `array_type' dworkin:/usr4/src/GNU/cmtest/CM >CC -o ctor_test1 ctor_test1.C Running /usr/new/bin/CC CC ctor_test1.C: cc -o ctor_test1 ctor_test1..c /usr/new/lib/libC.a dworkin:/usr4/src/GNU/cmtest/CM >ctor_test1 a.derived[0].base.base_fild = 17 a.derived[1].base.base_fild = 17 a.derived[2].base.base_fild = 17 a.derived[3].base.base_fild = 17 a.derived[4].base.base_fild = 17 a.derived[5].base.base_fild = 17 a.derived[6].base.base_fild = 17 a.derived[7].base.base_fild = 17 a.derived[8].base.base_fild = 17 a.derived[9].base.base_fild = 17 dworkin:/usr4/src/GNU/cmtest/CM >g++ -E ctor_test.C # 1 "ctor_test.C" # 1 "/usr/new/include/CC/stdio.h" extern struct _iobuf { int _cnt; unsigned char *_ptr; char *_base; int _bufsiz; short _flag; char _file; } _iob[20 ]; extern int _flsbuf(unsigned,struct _iobuf *); extern int _filbuf(struct _iobuf *); extern struct _iobuf * fopen(const char*, const char*); extern struct _iobuf * fdopen(int, const char*); extern struct _iobuf * freopen(const char*, const char*, struct _iobuf *); extern long ftell(const struct _iobuf *); extern char* fgets(char*, int, struct _iobuf *); extern char* gets(char*); extern int puts(const char*); extern int fputs(const char*, struct _iobuf *); extern int printf(const char* ...); extern int fprintf(struct _iobuf *, const char* ...); extern int sprintf(char*, const char* ...); extern int scanf(const char* ...); extern int fscanf(struct _iobuf *, const char* ...); extern int sscanf(char*, const char* ...); extern int fread(char*, unsigned int, int, struct _iobuf *); extern int fwrite(const char*, unsigned int, int, struct _iobuf *); extern int fclose(struct _iobuf *); extern int fflush(struct _iobuf *); extern void clearerr(struct _iobuf *); extern int fseek(struct _iobuf *, long, int); extern void rewind(struct _iobuf *); extern int getw(struct _iobuf *); extern int fgetc(struct _iobuf *); extern struct _iobuf * popen(const char*, const char*); extern int pclose(struct _iobuf *); extern int putw(int, struct _iobuf *); extern int fputc(int, struct _iobuf *); extern void setbuf(struct _iobuf *, char*); extern int ungetc(int, struct _iobuf *); extern void exit(int); extern int abort(...); extern int atoi(const char*); extern double atof(const char*); extern long atol(const char*); extern struct _iobuf *tmpfile (); extern char *ctermid(char*), *cuserid(char*), *tempnam(char*, char*), *tmpnam(char*); extern void perror (const char*); extern int errno; extern char* sys_errlist[]; extern int sys_nerr; extern unsigned char *_bufendtab[]; # 140 "/usr/new/include/CC/stdio.h" # 1 "ctor_test.C" struct base_type { int base_field; base_type(int ini_base_field = 17); }; base_type::base_type(int ini_base_field) { base_field = ini_base_field; } struct derived_type { base_type base; derived_type(); }; derived_type::derived_type():base() { } struct array_type { derived_type derived[10]; array_type(); }; array_type::array_type():derived() { } void main() { array_type a; int x; for(x = 0; x < 10; x++) printf("a.derived[%d].base.base_fild = %d\n",x,a.derived[x].base.base_field); } dworkin:/usr4/src/GNU/cmtest/CM >g++ -o ctor_test ctor_test.C /usr/new/include/CC/stdio.h:98: warning: lazy prototyping frowned upon dworkin:/usr4/src/GNU/cmtest/CM >ctor_test a.derived[0].base.base_fild = 17 a.derived[1].base.base_fild = 17 a.derived[2].base.base_fild = 17 a.derived[3].base.base_fild = 17 a.derived[4].base.base_fild = 17 a.derived[5].base.base_fild = 17 a.derived[6].base.base_fild = 17 a.derived[7].base.base_fild = 17 a.derived[8].base.base_fild = 17 a.derived[9].base.base_fild = 17 dworkin:/usr4/src/GNU/cmtest/CM >CC -o ctor_test ctor_test.C Running /usr/new/bin/CC CC ctor_test.C: "ctor_test.C", line 34: sorry, not implemented: initializer for class member vector with constructor 1 error dworkin:/usr4/src/GNU/cmtest/CM >