Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!psuvax1!psuvm!cunyvm!ndsuvm1!mtus5!zhhu From: ZHHU@MTUS5.BITNET Newsgroups: comp.sys.amiga.tech Subject: Re: Is this a Lattice C 5.05 compiler bug ? Message-ID: <90303.131300ZHHU@MTUS5.BITNET> Date: 30 Oct 90 18:13:00 GMT Organization: Computing Technology Services, Michigan Technological Univ. Lines: 40 >In article <90297.145845ZHHU@MTUS5.BITNET> ZHHU@MTUS5.BITNET writes: >>Whenever an unsigned integer multiply a float or a double, it will >>crash my Amiga 1000, but the same source code works fine on a PC or >>UNIX machine. This is painful, because you can be careful by type >>casting, but when you compile a PD program, especially the big files >>you cannot afford the time to find them. I use Lattice C compiler 5.05, >>I wonder if this is a bug, whether 5.10 have the same problem. Can >>any body kindly take the risk of crashing, and try the following: >> >>#include >>main() >>{ >> unsigned int i; >> int j; >> float a; >> i = 10; >> j = 10; >> a = j*15.0; /* should not crash here */ >> printf("a= %f:n",a); >> a = i*15.0; /* crash here on my machine*/ >> printf("a= %f:n",a); >>} > >I own an Amiga 2000 and Lattice C5.05; the program works fine when >compiled with > > lc -f -Lm prog > > -- Frank I try to compile the program using the "-f" switch, it won't crash the machine any more, thank you Frank. But my question now is: Why it crashes my A1000 when I compile using lc -Lm prog According to the Lattice C manual, the default switch is "-fm" which means mixed float and double type. --Zhiquan