Path: utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bbn!csd4.milw.wisc.edu!mailrus!rutgers!ucsd!orion.cf.uci.edu!uci-ics!crimee.ics.uci.edu!schmidt From: schmidt@crimee.ics.uci.edu (Doug Schmidt) Newsgroups: gnu.g++.bug Subject: Re: Apparent bug in G++ 1.32.0 - error message no issued Message-ID: <4942@paris.ics.uci.edu> Date: 21 Jan 89 01:04:18 GMT References: <8901202252.AA10430@riunite.aca.mcc.com> Sender: news@paris.ics.uci.edu Reply-To: Doug Schmidt Distribution: gnu Organization: University of California, Irvine - Dept of ICS Lines: 63 In article <8901202252.AA10430@riunite.aca.mcc.com> rfg@MCC.COM (Ron Guilmette) writes: > >I'm not sure if this is a bug in G++ (1.32.0), a bug in the language >definition itself, or just a strange feature, but here goes. Consider >the following code: > >//////////////////////////////////////////////////////////////////////////// >class first_class; > >class second_class { >public: > first_class some_function (); >} > >another_function () >{ > second_class second_class_object; > > second_class_object.some_function (); >} >Any comments? Could somebody please see what AT&T cfront does with this. > cfront screws up also, here's the diagnostics from 1.2.1: ---------------------------------------- CC foo.c: "foo.c", line 13: warning: second_class_object used but not set "foo.c", line 13: warning: no value returned from another_function() cc foo.c..c /cd/ua/schmidt/lib/sun4/mylib.a /cd/ua/schmidt/lib/sun4/strlib.a -lC "foo.c", line 12: undefined structure or union mv: foo.c..o: Cannot access: No such file or directory ---------------------------------------- The last error is propagated through to the C compiler! Here's a portion of the generated C source code: ---------------------------------------- "foo.c", line 13: warning: second_class_object used but not set "foo.c", line 13: warning: no value returned from another_function() struct second_class { /* sizeof second_class == 2 */ char _dummy; }; struct first_class _second_class_some_function (); int another_function () { struct second_class _au1_second_class_object ; _second_class_some_function ( & _au1_second_class_object ) ; } ; ---------------------------------------- Doug -- schmidt@ics.uci.edu (ARPA) | Per me si va nella citta' dolente. office: (714) 856-4043 | Per me si va nell'eterno dolore. | Per me si va tra la perduta gente. | Lasciate ogni speranza o voi ch'entrate.