Article View: gnu.g++
Article #364Possible cfront 1.1 bug
From: Michael Tiemann
Date: Mon, 20 Feb 1989 00:09
Date: Mon, 20 Feb 1989 00:09
39 lines
1366 bytes
1366 bytes
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 <stream.h>
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
Technical Details
Message-ID:
<8902200009.AA01957@yahi.Stanford.EDU>Path:
arc1-ca.pugleaf.net!utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!YAHI.STANFORD.EDU!mdtReferences:
<6317@saturn.ucsc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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