mdt@YAHI.STANFORD.EDU (Michael Tiemann) (02/20/89)
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