Path: utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!YAHI.STANFORD.EDU!mdt From: mdt@YAHI.STANFORD.EDU (Michael Tiemann) Newsgroups: gnu.g++ Subject: Possible cfront 1.1 bug Message-ID: <8902200009.AA01957@yahi.Stanford.EDU> Date: 20 Feb 89 00:09:10 GMT References: <6317@saturn.ucsc.edu> Sender: daemon@tut.cis.ohio-state.edu Reply-To: tiemann@lurch.stanford.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 39 There appears to be a bug in cfront 1.1 which causes this program to print garbage in the third output. We've found three ways of sidestepping the bug. 1) replace all instances of float with double 2) use a local variable in foo(); pass the address of the local 3) use the oregon C++ compiler I've found a fourth way: use the GNU C++ compiler. =-=-=-=-=-=-=-=-=-= #include void foo(float l); void bar (float *lp); main() { float l=1.5; cout << "main: l == " << l << "\n"; foo(l); } void foo(float l) { cout << "foo: l == " << l << "\n"; bar(&l); } void bar (float *lp) { cout << "bar: *lp == " << *lp << "\n"; } =-=-=-=-=-=-=-=-=-= ************************************************************** Daniel Edelson daniel@saturn.ucsc.edu Michael